#if you just want the desired Z rotation
1 messages · Page 1 of 1 (latest)
i think a thread would make formatting this conversation easier sorry
anyways the double slashed code was the original code but had no smooth transition, just instantaneous rotation to my desired z value, which was perfect aside from the fact that it didnt ease in or out which Slerp does
my only issue was that i didnt know how to implement Slerp into the "float angle = Mathf.Atan2(lookDir.y, lookDir.x) * Mathf.Rad2Deg - 90f;" code
or "rb.rotation = angle;"
you can use that angle you got for the MoveRotation method on the rigidbody which will rotate the rigidbody over the next frames so it reaches the desired rotation by the next FixedUpdate