/// @description Insert description here // You can write your code in this editor x = oPlayer.x; y = oPlayer.y; if gamepad_is_connected(0) { var haxis = gamepad_axis_value(0, gp_axisrh); var vaxis = gamepad_axis_value(0, gp_axisrv); image_angle = point_direction(oPlayer.x, oPlayer.y, haxis, vaxis); } else { image_angle = point_direction(oPlayer.x, oPlayer.y, mouse_x, mouse_y); } if(image_angle > 90 && image_angle < 270) { layer = layer_get_id("gunBack"); } else { layer = layer_get_id("gunFront"); }