#if you just want the desired Z rotation

1 messages · Page 1 of 1 (latest)

summer spindle
#

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;"

main girder
#

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

summer spindle
#

holy smokes i feel so simple thats actually a much better solution

#

hold on ill implement it