- Home /
Question by
sean244 · May 19, 2018 at 09:55 PM ·
inputmouseonmousedown
How to detect when the mouse button is being held down while the cursor is inside a collider?
I know that if I use OnMouse down, Unity can register individual clicks inside a collider, but how can Unity detect if the mouse button is being held down inside a collider?
Comment
Best Answer
Answer by spilat12 · May 19, 2018 at 10:30 PM
Use OnMouseEnter()
Called when the mouse enters the GUIElement or Collider. The corresponding OnMouseOver function is called while the mouse stays over the object and OnMouseExit is called when it moves away.
Your answer
