epicguy
Member
In the
And so, this is supposed to change the gun sprite to be pointing right if the cursor is on the right side of the player, and left if it is on the left side. However, this does not work. Any way on how to make it work?
obj_gun
object, and within it's step event, I have this:
GML:
x = obj_player.x;
y = obj_player.y;
image_angle = point_direction(x,y,mouse_x,mouse_y);
direction = image_angle;
if (image_angle > 180) {
sprite_index = spr_gunright;
} else {
sprite_index = spr_gunleft;
}