Thursday, July 3, 2025

Unity 6 2 Beta OnMouseDown Not Working Solved


Unity 6.2 Beta – OnMouseDown Not Working: Quick Fix

  • Problem: OnMouseDown() event not triggering on 3D objects like Sphere in Unity 6.2 beta.

  • Cause: Unity 6.2 uses the New Input System by default, which doesn't support legacy OnMouseDown() events.

  • Expected Setup:

    • Script with OnMouseDown() attached to GameObject (e.g., Sphere).

    • GameObject has collider component.

    • Script logs "Click" to console.

  • But: Event never fires due to input system incompatibility.


Solution

  1. Go to Edit > Project Settings > Player.

  2. Under Other Settings, find Active Input Handling.

  3. Change from Input System Package (New)Both.

  4. Apply changes and restart Unity when prompted.

  5. Re-test the click in Play Mode → ✅ OnMouseDown() works now!


💡 Notes

  • Use "Both" option to support legacy and new input systems.

  • Useful when migrating older Unity projects to 6.2 beta or later.

No comments: