Garry's Mod Wiki

math.ApproachAngle

  number math.ApproachAngle( number currentAngle, number targetAngle, number rate )

Description

Increments an angle towards another by specified rate.

This function is for numbers representing angles (0-360), NOT Angle objects!

Arguments

1 number currentAngle
The current angle to increase
2 number targetAngle
The angle to increase towards
3 number rate
The amount to approach the target angle by

Returns

1 number
Modified angle