How to smoothly rotate gameobject 20 degrees on key press?
Hello, I have a C# script where I want to rotate a gameobject +20 degrees on the Z axis every time I press the right arrow. I know how to do the rotation, but when I do it, it is too snappy. I want the rotation to be smooth. I am pretty sure I have to use quaternions, and maybe a coroutine, but not sure how to do it. Any help would be appreciated, thank you!
P.S. C# only please
How is this code: if (Input.Get$$anonymous$$ey($$anonymous$$eyCode.RightArrow)) { rigidbody.AddRelativeTorque(new Vector3(0, 0, 20), Force$$anonymous$$ode.Acceleration); }
Your answer
Follow this Question
Related Questions
Rotate on Transform.localeulerAngels smoothly 0 Answers
Smooth 360 degree rotation every keypress - C# 0 Answers
Smooth look at 0 Answers
How to have smooth rotation? 0 Answers
i need to smooth my gun ,my gun prefabe is children. 1 Answer