GML [SOLVED] Smooth "point_direction" problem.

E

Edwin

Guest
VIDEO:
Hello! I have a problem with the angles, using point_direction.
So basically, hammer weapon (object) have this Step Event code to return the direction of mouse position:

Code:
mouseDir = point_direction(x, y, mouse_x, mouse_y);
image_angle += (mouseDir - image_angle) * 0.25;
This works perfectly, but I have a problem that you can see in video on 18 seconds:
Hammer is trying to smoothly set angle to 360° from 0° and to 0° from 360°, but it's look not so good.

How to fix it?
 
Top