Question by
Ustankme · Mar 30, 2019 at 07:16 PM ·
quaternionrotate objectvector2d rotation
Changing a Transform's rotation to match a Vector using Quaternions
So I want to rotate my player characters arm to point towards the mouse cursor. For this I have a Vector3 (or Vector2, as it's a 2D game) pointing from the arm's base to the Cursor. Just changing the arm's transform.right works, but the Euler angles cause issues at certain rotations.
Because of this I'd like to use Quaternions to either set the Transform's rotation to match the Vector3 or (preferably) interpolate it towards that direction with a certain speed. How can I do this?
Comment