R
risa401
Guest
Hello! I got a little problem with my smooth rotation code.
Code:
What happens:
Let's say the angle is 180 and now I want to turn to angle 0. Never will happen (unless I move it to a number not opposite to the opposite side [confusing I know]), I know that. How do I make it able to do that?
Thanks!
GIF: http://imgur.com/a/EjGJZ
Code:
Code:
var _pointDir = point_direction(x, y, x + lengthdir_x(16, direction), y + lengthdir_y(16, direction));
legAngle += sin(degtorad(_pointDir - legAngle)) * legAngleSpeed;
Let's say the angle is 180 and now I want to turn to angle 0. Never will happen (unless I move it to a number not opposite to the opposite side [confusing I know]), I know that. How do I make it able to do that?
Thanks!
GIF: http://imgur.com/a/EjGJZ
Last edited by a moderator: