- Home /
How do I rotate an object smoothly?
Hello.
I have a camera in my scene, and I cannot figure out how to make it rotate smoothly. I understand how to make it rotate, but not with any damping.
How would this be done?
Tate
I tried this, but the object does not move smoothly, it just moves.
var rotateYspeed : float = 1.0 ;
transform.Rotate(0, rotateYspeed * Time.deltaTime, 0);
...or look into quaternions ?
yeah lol I was just throwing that up there for tate to try wherever (s)he's using it...
edit : Idk what (s)he has for code either, so no clue what (s)he's already tried/trying... I haven't had a problem with anything just "moving" (snapping?) to certain rotations yet.
Answer by asafsitner · Dec 21, 2011 at 09:55 AM
Take a look at `Quaternion.Slerp` (Vector3.Lerp and angles can cause some interesting and fearsome bugs and using Quaternions is safer and faster than using Vector3.Slerp).
Rotate a proxy, then slerp between your actual transform's rotation to the proxy's rotation.
http://unity3d.com/support/documentation/ScriptReference/Quaternion.Slerp.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613062245im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Use Lerp to rotate object 2 Answers
smooth fps movements using joystick 1 Answer
Move object in an arc 3 Answers
Return Camera Rotation Z axis to 0 2 Answers