- Home /
Testing mobile with Mouse input
According to the manual:
On top of native touch support Unity iOS/Android provides a mouse simulation. You can use mouse functionality from the standard Input class.
http://docs.unity3d.com/Documentation/Manual/Input.html
Does this mean I can code my input to the Mouse and it will work on mobile with one finger?
Answer by vividhelix · Oct 31, 2013 at 05:40 AM
The mouse input works on iOS/Android however the way it does when dealing with multi-touch is that it finds the center of all the touches - for example if you touch two opposite corners of your screen, it will get one mouse event halfway between the two touches (in the middle of the screen). Also, obviously, mouse input doesn't know which finger triggered the touch (no such thing as a touch id for mouse).
I rolled my own implementation very similar to OnMouseDown, OnMouseUp etc that keeps track of finger id and will deliver events to the proper game object.