SOLVED trouble with image_angle

Nocturne

Friendly Tyrant
Forum Staff
Admin
Moderator
Hello! You want to clamp the image angle to specific values. The easiest way to do this is to simply do:
GML:
var _d = point_direction(x, y, mouse_x, mouse_y);
if _d > 45 _d = 45;
if _d < 315 _d = 315;
image_angle = _d;
That will work when the instance is facing RIGHT only though. If you want it to clamp when facing left or right then you'll need to modify that code somewhat... :)
 
Top