Answers for "Use Lerp to rotate object"
http://answers.unity.com/questions/848121/use-lerp-to-rotate-object.html
The latest answers for the question "Use Lerp to rotate object"Answer by Baste
http://answers.unity.com/answers/848138/view.html
I'd go with Quaternion.RotateTowards, as it's nice and compact. Example for W:
if (Input.GetKeyDown (KeyCode.W))
{
Quaternion currentRotation = transform.rotation;
Quaternion wantedRotation = Quaternion.Euler(0,0,90);
transform.rotation = Quaternion.RotateTowards(currentRotation, wantedRotation, Time.deltaTime * rotateSpeed);
}
Where rotateSpeed is a float variable just like speed. This will work for the majority of cases- lerping takes quite a bit of extra maths to get right if the distance you're going to rotate varies.Sat, 06 Dec 2014 12:11:30 GMTBasteAnswer by b1gry4n
http://answers.unity.com/answers/848123/view.html
use transform.rotation : http://docs.unity3d.com/ScriptReference/Transform-rotation.html
convert to quaternion (or replace current euler values) : http://docs.unity3d.com/ScriptReference/Quaternion.Euler.html
slerp : http://docs.unity3d.com/ScriptReference/Quaternion.Slerp.html
how to correctly lerp : http://www.blueraja.com/blog/404/how-to-use-unity-3ds-linear-interpolation-vector3-lerp-correctly
difference between lerp and slerp : https://www.youtube.com/watch?v=uNHIPVOnt-Y#t=30Sat, 06 Dec 2014 11:32:50 GMTb1gry4n