Search code examples
unity-game-enginequaternions

Rotate/Lerp Gameobject 90 degrees (Unity)


Alright, I'm new to this stuff and the internet is confusing me pretty hard. You have Euler Angles, Quaternions; one uses degrees, the other radians, you should use lerp, slerp, lookat, you can't set pivots manually without parent objects... etc.

What I want to do is gradually rotate a gameobject around its pivot point 90 degrees clockwise in Z whenever I press a key. It's like a Tetris block.

I'm really looking for a short, simple explanation so I understand what I'm doing and to avoid further confusion. Help would really be appreciated! Thanks!


Solution

  • The answer is: use the linear interpolate functions in combination with a coroutine.