- Home /
Duplicate Question
How to move an object using mouse just like the swipe in iOS?
I am making a multiplatform game. iOs and windows. but my problem is, i want to simulate iOS swipes using my mouse. example: if i swipe going up, my character will jump. if i swipe to left, my character goes left. and if i swipe right, my character goes right. i need a c# script. but if you prefer javascript, it will also help.
Answer by Graham-Dunnett · May 07, 2013 at 10:53 AM
First example on this page:
http://docs.unity3d.com/Documentation/ScriptReference/Input.GetTouch.html
shows how to move an object in response to a finger move.
Second example on this page:
http://docs.unity3d.com/Documentation/ScriptReference/Input.GetAxis.html
shows how to rotate and object in response to a mouse move.
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
destroy object by using line renderer 1 Answer
Throw with mouse 1 Answer
Mouse Swipe and Code Efficiency 0 Answers
Multiple Cars not working 1 Answer