• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Turning Speed to Follow Mouse

Right now I'm changing my sprite to turn towards where the mouse is on the screen. Problem is I don't want it being spot on. I want it to move slower than the mouse. Any way to do that? I've thought about using the lerp function but haven't tried it. Would that work or am I thinking wrong?
 
Use angle_difference(src,dest) to find the closest direction to turn, and how many degrees to reach the angle goal. An example would be like this:
GML:
ang = angle_difference(image_angle,object_target.image_angle)
image_angle += min(ang,sign(ang))
//not sure if this works....
 
Use angle_difference(src,dest) to find the closest direction to turn, and how many degrees to reach the angle goal. An example would be like this:
GML:
ang = angle_difference(image_angle,object_target.image_angle)
image_angle += min(ang,sign(ang))
//not sure if this works....
Thanks. I'll give this a try.
 
Top