Detect if mouse has clicked on a UI element?
This is a pretty simple question, but it seems something has changed lately and the answers I've found on the internet are no longer valid, so here goes nothing:
I got some UI elements, and a "InputController" class which is intended to handle the user input during the game (Input on the controllers are handled through the onclick events).
What I'm looking is for a way to being able to know if the mouse is clicking a UI element to block the execution of my input handling (and avoid the user clicking on "pause" while also the game executes "left button clicked."
Now, most solutions I've fond were a bit messy or used EventSystem.current.IsPointerOverGameOBject()
, which in 2019.4 does not longer appear. So, there's any new way to do this, do I have to make some hacky solution to receive the event from the UI, then block the execution of my code or am I missing something here?
Your answer
Follow this Question
Related Questions
NullReference in Eventsystem Raycast eventCamera 0 Answers
Gamepad input in UI stop working after a new panel cover the first one 0 Answers
How can i ask a user for their name? 1 Answer
How to make UI Button serves as buttons for Input.getAxis()? 0 Answers
New Input System issue with UNet/Mirror Multiplayer 1 Answer