Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug OnMouseDown Triggering twice when using the simulator view

Discussion in 'Input System' started by unity_2qI9RT0XP4n_jA, Apr 12, 2023.

  1. unity_2qI9RT0XP4n_jA

    unity_2qI9RT0XP4n_jA

    Joined:
    May 27, 2018
    Posts:
    2
    I'm using the simulator view to see how my game looks on different devices
    https://docs.unity3d.com/Manual/device-simulator-view.html

    However my inputs are not working correctly because OnMouseDown is being triggered twice. The first time when I press the mouse button and a second time when I lift my finger.
    This does not happen when I'm in the normal game view or when I build (for android in this case)

    Anyone has the same issue? Can anyone confirm that this is actually a bug?
    I just upgraded from version 2021.3.8f1 to 2021.3.22f1 and the problem still exists
     
  2. TheDahaka

    TheDahaka

    Joined:
    Nov 11, 2016
    Posts:
    9
    In case anyone's having this problem, maybe this will help. I have the same issue on a couple of projects (Unity 2022.3.4f1), unfortunately I'm unable to reproduce it on a clean project... so I suspect there's probably an interaction with a package or a setting? In the end, I tried using the EventSystem (IPointerDownHandler, etc...) and that doesn't have the issue on the simulator.