OnMouseDown makes my game screen to flash

If i click anywhere in my game window (when playing), it makes my screen to flash somehow. It gets darker and back to normal when i release the mouse button. What could be the cause? It is really anoying :frowning: Unity 2019.3.6f1. Thank you.

Hi Darxas,

That sounds indeed strange. Have you already implemented any code that does something when you click the mouse button? If so, check that code. Maybe it enables/disables a game object in your scene.

Little update.

If i uncheck “Standalone Input Module” component in my EventSystem, flashes stops and the game works great. Same goes for “Graphic Raycaster” component in Canvas.

There are 2 OnMouseDown functions checking what object was clicked on. I dont have this problem with my previous projects (no mouse clicks untill now) so hopefully when i start TileVania tommorrow things’ll get back to normal :frowning:

How are you getting on with this, @Darxas? Did the issue reappear?

I’ve found the problem … my background image on a Canvas had Button component. Haha. No idea how it got there. My apologies :o)

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms