Question by
SimonClintonIv · Jun 15, 2016 at 10:27 AM ·
rotationlerp
How to use lerp to rotate an object to its given rotation
I want to rotate an object to the rotation I wish. It may be 90 degree along X axis or anything else but using lerp. So how can I do this.
Comment
Best Answer
Answer by mr-gelmir · Jun 15, 2016 at 10:46 AM
You can use the Vector3 or Quaternion Lerp functions to rotate your Transform. Just use the corresponding functions (setEulerAngles or setRotation) on the transform.
Then it is just a matter of modulating the last value of the Lerp functions from 0 to 1. This can be done using a local variable and adding the Time.deltaTime in the Update function, or by using a Coroutine.
Hope this sets you in the right direction.
Okay I give up, there is no way to assign rotation manually