- Home /
OnPointerEnter/OnPointerExit does not update when mouse is not moveing?
Trying to use the new Input system and it requires you to use OnPointerEnter and OnPointerExit for mouse interactions with 3d objects.
I have both of these functions working properly if I move the mouse over an object it highlights the object.
However if I leave my mouse stationary and the object passes underneath it these events do not fire. It seems the OnPointerEvents dont trigger unless the mouse is moving. Is there a way to force the OnPointerEvents to always be triggerable? Effectively leaving the raycast on in Update?
Answer by HitarthPadaliya · Oct 29, 2020 at 11:17 AM
These functions are for 2D elements and not for 3D objects. Even I tried this and found it not working because they are not meant to do so.
Instead you can use OnMouseOver () and OnMouseExit () functions. I've tested and they work fine.
Thank you, but I was trying to use the On$$anonymous$$ouse events before switching to OnPointer and was having no luck with the new Input system in place.
With Physics Queries on hit checked Box collider trigger enabled And a script attached to the object intended to be hit containing On$$anonymous$$ouseOver() I was not able to get any interaction with the debugger.
Is there something that must be added in order to get the On$$anonymous$$ouse events to fire with the new Input system in use?
Your answer
Follow this Question
Related Questions
Problem with Alt + Middle Click Drag for Camera (Windows) 3 Answers
Detect mouse movement 1 Answer
Huh click and go script working 50% 0 Answers
Make a character follow mouse when button is held down 1 Answer
c# scripting navigation problems 1 Answer