Skip to main content

Vector3.Slerp(Vector3 a, Vector3 b, number t)

Spherically interpolates between two vectors.

Parameters:

NameTypeDescription
aVector3
bVector3
tnumberis clamped to the range [0, 1].

Returns:

typeDescription
Vector3Spherically interpolated Vector3

Usage

---@type Vector3
local a;

---@type Vector3
local b;

---@type number
local t;


local val0 = Vector3:Slerp(a, b, t)

Extra Detail

Interpolates between a and b by amount t. The difference between this and linear interpolation (aka, "lerp") is that the vectors are treated as directions rather than points in space. The direction of the returned vector is interpolated by the angle and its magnitude is interpolated between the magnitudes of from and to.