Skip to main content

rotate_toward

Function rotate_toward 

pub fn rotate_toward(from: f64, to: f64, delta: f64) -> f64
Expand description

Rotates from toward to by the delta amount. Will not go past to.

Similar to [method move_toward], but interpolates correctly when the angles wrap around @GDScript.TAU.

If delta is negative, this function will rotate away from to, toward the opposite angle, and will not go past the opposite angle.