Vector3.RotateTowards Manual     Reference     Scripting  
Scripting > Runtime Classes > Vector3
Vector3.RotateTowards

static function RotateTowards (current : Vector3, target : Vector3, maxRadiansDelta : float, maxMagnitudeDelta : float) : Vector3

Description

Rotates a vector current towards target.

The vector will be rotated on an arc instead of being interpolated linearly. This is essentially the same as Vector3.Slerp but instead the function will ensure that the angular speed and change of magnitude never exceeds maxRadiansDelta and maxMagnitudeDelta. Negative values of maxRadiansDelta and maxMagnitudeDelta pushes the vector away from target.