RedKnight91

face_point(p_x,p_y)

Jan 23rd, 2019
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. //Rotate to face toward mouse
  2. var _tgt_angle = point_direction(x, y, argument0, argument1);
  3. image_angle -= angle_difference(image_angle, _tgt_angle) * 0.3;
  4.  
  5. //This code can be used to restrict rotation to a range
  6. //image_angle = clamp(image_angle, angle_min, angle_max);
  7.  
  8. image_angle = wrap(image_angle, 0, 360);
Advertisement
Add Comment
Please, Sign In to add comment