Hey guys! Simple question here. I used this formula to rotate an object towards a direction using x and y co-ordinates. Now I can't seem to figure out how to modify this to rotate an object towards a value stored in an alterable value inside the object
A.angle + Max(Min((((ATan2(A.y - B.y, B.x - A.x) - A.angle + 540) mod 360) - 180), Rotation), - 1 * Rotation)
I upgraded my level editor to allow you to rotate objects in the game. The objects use the physics engine and auto rotate back to their original angles if disturbed. Or they are supposed to. I just need a formula that compares the objects current angle to the one stored in the alterable value and rotates it slowly back to the stored position. Any help would be great! Thanks in advance!
Here is an example of how it should work with the rotating
Please login to see this link.