Search Unity

Mouse functions on mobile ?

Discussion in 'Scripting' started by skopusnik, Aug 6, 2020.

  1. skopusnik

    skopusnik

    Joined:
    Jul 22, 2019
    Posts:
    7
    Hello.

    Are mouse functions working on mobile ?

    Like OnMouseUp, Input.GetMouseButtonDown, Input.GetMouseButton,Input.GetMouseButtonUp,...

    or i need to change them all for mobile ? Because they work on my phone, but idk if it will work on all other phones. On build i get warning about this:

    Game scripts or other custom code contains OnMouse_ event handlers. Presence of such handlers might impact performance on handheld devices.

    I'm using latest Unity 2020.

    Regards
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    Generally on multitouch mobile, the mouse will function as an average of ALL TOUCHES.

    This might be fine, and a lot of applications don't care and just let this happen.

    Keep in mind if you have a button and touch 2 fingers on either side (outside) the button, then release it, the button will think it has been touched by the mouse. You might not want this.
     
    Esha_M, Siliko and skopusnik like this.