Skip to content

vec3MoveToward

vec3MoveToward(current, target, delta): Vec3

Defined in: src/modules/math/vec3.ts:99

current stepped delta units along the straight line to target — the Vec3 sibling of vec2MoveToward. A forward mover cannot overshoot: once the remaining distance is within delta the target itself is returned, so repeated calls settle on it instead of oscillating around it.

delta is a signed step: a negative one walks away from the target, and 0 leaves the position unchanged.

Vec3

Vec3

number

Vec3