- Home /
This question was
closed Oct 07, 2014 at 02:46 PM by
robertbu for the following reason:
Duplicate Question
Rotate object towards mouse position
Hello. I have arrow sprite with pivot on the start of the arrow.
Now I need to rotate that arrow in 2d so it always points towards the mouse. It needs to be done with lerp
or slerp
so when I move mouse too fast, it doesn't jump there but it slowly slides to that position.
Comment
Answer by robertbu · Oct 07, 2014 at 02:46 PM
Various forms of this code has been posted to UA many times. You can comgine these two:
http://answers.unity3d.com/questions/603757/2d-mouse-aiming.html
http://answers.unity3d.com/questions/650460/rotating-a-2d-sprite-to-face-a-target-on-a-single.html