OnMouse events not working [fixed]

Posted for others who have this problem but can’t resolve it.

Operating in URP on 2019.4.3f1 with a mix of the old and new Input systems. Some combination of actions and edits led to OnMouseOver, OnMouseExit, etc. not working. Perhaps it was never working as I was only just learning how to use it.

Tried all the suggested tips, nothing worked.

Finally, after a day of hair pulling, this worked.

  1. ensure that Player Settings → Input System are set to ‘both’
  2. Assets → Reimport All

Maybe ‘Reimport All’ is a catchall fix for new players :slight_smile:

Please note that this has nothing to do with physics which is where you’re posting.

1 Like

Sorry, I wasn’t sure where the problem actually lay. As OnMouse… depends on colliders I thought Physics was appropriate.

Should I move it?

No it’s fine. I just wanted to highlight that it wasn’t related to physics.

Whilst OnMouse etc might use physics colliders, the mouse/callbacks are a UI thing and are not implemented, supported or related to physics; it’s just another user of physics colliders in the same way that the particle system hitting colliders isn’t implemented by physics. Totally understand that you wouldn’t know that of course. :slight_smile:

Just for your info, these are the UI and Input forums.

1 Like