- Home /
Question by
rupeshpamaihgari · Aug 06, 2013 at 08:12 PM ·
inputmouse-dragevent-handling
how to detect horizantal and vertical drag on screen by mouse.?
I have an game object to which I have to rotate right by dragging mouse horizontally from left to right and similarly to rotate left,up and down.Could any one please help me by giving script for these mouse events...!..thanks in advance
Comment
Answer by Ejlersen · Aug 06, 2013 at 08:19 PM
If you have standard Input setup in your project, then you can get x-axis by:
Input.GetAxis("Horizontal");
And y-axis by using:
Input.GetAxis("Vertical");
Then you can use the output to rotate your object.