|
Hi all! I want to rotate a transform to a specific angle, not add to the existing rotation. Currently, on every frame, I am doing: transform.Rotate(Vector3.up * rotation); What I expect is a smooth transition over time as "rotation" changes, however the object is spinning like crazy! Do I need to use a method to grab the current rotation and then offset by that? Or is there a method that will allow me to directly set the rotation? Thanks!
(comments are locked)
|
|
transform.localEulerAngles = new Vector3(x,y,z);
(comments are locked)
|

You should use Time.deltaTime, since that line of code is not framerate-independent and will vary as the framerate varies.
I know what I'm doing with the angle itself, my question is about how to set the absolute rotation of the object, not just adjust the rotation.
Transform.eulerAngles?
Thank you! Works perfectly.