Comments and answers for "Use Lerp to rotate object"
http://answers.unity.com/questions/848121/use-lerp-to-rotate-object.html
The latest comments and answers for the question "Use Lerp to rotate object"Comment by samra2494 on samra2494's answer
http://answers.unity.com/comments/1742517/view.html
Not work for me because I have x and y is not zeroTue, 16 Jun 2020 10:03:01 GMTsamra2494Comment by vortexbytes on vortexbytes's answer
http://answers.unity.com/comments/1220435/view.html
This works thanks!Sun, 24 Jul 2016 18:24:29 GMTvortexbytesComment by 0mr_ashutosh0 on 0mr_ashutosh0's answer
http://answers.unity.com/comments/848141/view.html
Thank you @BasteSat, 06 Dec 2014 12:14:21 GMT0mr_ashutosh0Comment by 0mr_ashutosh0 on 0mr_ashutosh0's answer
http://answers.unity.com/comments/848140/view.html
Thanks @b1gry4n again :)Sat, 06 Dec 2014 12:14:06 GMT0mr_ashutosh0Answer 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