- Home /
Question by
gimoj · May 26, 2014 at 06:29 AM ·
gameobjectmouseaxisflipmouse-drag
Make the gameobject flip to the direction it is being dragged to?
float h = Input.GetAxis("Mouse Y");
if(h > 0 && !facingRight)
Flip();
else if(h < 0 && facingRight)
Flip();
I got this from the tutorial but when I use this the game object flips not when it's being dragged but whenever you move the mouse and sometimes very randomly. Is there a way to make the gameobject face the direction it is being dragged to?
Comment
Best Answer
Answer by gimoj · May 26, 2014 at 01:34 PM
Never mind it took me a while but apparently all I had to do was to change the y with an x.