Using Rotation in a Game?

Dr.Wiggles

New member
I've been have this problem for a while so I thought id finally ask about it
I have 2 variables and a object,
one variable (rot) represents the object's current rotation
the other variable represents the rotation the object should be at (ert)

This is my code for the tween

rot -= (rot-ert)/5

This code creates a nice tween, because the object will slowly move towards the rotation its supposed to be at but never actually reach it

The problem is when rot is equal to 360 and ert is equal to 0
The object will spin all the way around. How can i go about fixing this?
Sorry if that was confusing any help appreciated!
 
Back
Top