- Home /
Question by
elsharkawey · Feb 19 at 09:50 AM ·
rotationrotaterotate object
how to slow down the rotation from to ?
this code makes my object go so fast from the current y rot to the target
i using working on a third person camera code that's making my charcter follow the camera rot when i press the arrow key
but it's turning around so fast when i press the key and i don't know how to slow it down
float rY = Mathf.SmoothStep(transform.eulerAngles.y,cam.transform.eulerAngles.y,1f - Time.deltaTime);
transform.eulerAngles = new Vector3( transform.eulerAngles.x, rY, transform.eulerAngles.z );
Comment
Best Answer
Answer by IvanBgd · Feb 19 at 12:49 PM
Try Quaternion.Lerp: https://docs.unity3d.com/ScriptReference/Quaternion.Lerp.html
Your answer

Follow this Question
Related Questions
How can I rotate an object without moving it up or down? 0 Answers
managing rotation of Turret on two axis 1 Answer
Strange rotation pattern. 0 Answers
Rotate an object back to its old rotation 1 Answer
How do I rotate using a negative angle value?,How to get the negative angle of an object? 2 Answers