You are currently viewing the GMLscripts.com static mirror. Forum access and script submissions are not available through this mirror.

Invert GMLscripts.com

turn_towards_direction

turn_towards_direction(target,rate)
Rotates the calling instance towards the target direction, at a given rate.
COPY/// turn_towards_direction(target,rate)
//
//  Rotates the calling instance towards the target direction,
//  at a given rate. 
//
//      target      angle to turn towards (degrees), real
//      rate        maximum turning rate (degrees), real
//
/// GMLscripts.com/license
{
    direction += median(-argument1, argument1, angle_difference(argument0, direction));
    return 0;
}

Contributors: xot

GitHub: View · Commits · Blame · Raw