1
Support / Rotate slowly to target?
« on: November 09, 2013, 02:48:54 am »
I've searched and used this code to rotate my object to a target:
But I'd like to add some rotation speed to this to make it rotate more slowly. How would I go about doing this?
Code: [Select]
Vector3 direction = targetPoint - transform.position;
transform.eulerAngles = new Vector3(0, 0, Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg);
But I'd like to add some rotation speed to this to make it rotate more slowly. How would I go about doing this?