Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SlerpUnclamped(Vector3, Vector3, float)

Spherically interpolates between two vectors.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static Vector3 SlerpUnclamped(Vector3 a, Vector3 b, float t)

Parameters

The first vector to interpolate between.

The second vector to interpolate between.

The amount to interpolate.

Returns

Type

Description

Vector3The spherically interpolated vector between
a
and
b
. Values of
t
outside the range [0, 1] extrapolate beyond
a
or
b
.

Remarks

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 Vector3.magnitude is interpolated between the magnitudes of
a
and
b
.
Note: This static method can slerp beyond the a and b vectors. This means t can be less than zero or greater than one.
Additional Resources: Vector3.Slerp.