How to Ignore Mouse Input with Unity's New Input System while Clicking on an UI Element?
I receive input from the mouse with the New Input System, but I do not want to receive input while the mouse is on any UI object, regardless of it being over or under any non-UI object. I tried EventSystem.current.IsPointerOverGameObject(). It seems to work, but it also gives a warning every time input is received. Calling IsPointerOverGameObject() from within event processing (such as from InputAction callbacks) will not work as expected; it will query UI state from the last frame UnityEngine.EventSystems.EventSystem:IsPointerOverGameObject () ... Here is my code: private void OnEnable() { mo
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.