I’m a newb, so bear with me. How would I go about taking an object, and rotating it smoothly (lerpangle I assume) from its current position to another angle on one axis after a single key press.
In other words, say I have a cube, and I want to press the up arrow (and release it), and then have it smoothly transition on the x axis by -10 degrees smoothly. I hope this makes sense! I tried doing it with various lerp functions, I can get this to work:
float angle = Mathf.LerpAngle (0.0f, 30.0f, Time.time);
transform.eulerAngles = new Vector3 (0, angle, 0);
But if I put it inside
if (Input.GetKeyDown(KeyCode.RightArrow))
Then it happens instantly. Thanks!