Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
RotationCurveKey
A time-value pair used with RotationCurve instances.
The Interpolation property dictates the interpolation mode for the segment started by this key and ended by the next key on the curve. Each segment may use a different interpolation mode.
The LeftTangent and RightTangent properties apply to the cubic interpolation mode and define the desired tangent (slope) at the key. Different left and right values can be used to encode discontinuities in slope at the key. Attempting to set a RightTangent value on a key that doesn't use the cubic interpolation mode will result in a runtime error. It is possible to set the LeftTangent property on any key, as it will be used should the preceding segment use cubic interpolation.
Constructors
| Name | Type / Returns | Description |
|---|---|---|
| RotationCurveKey.new | Returns a new RotationCurveKey at a given time with a given CFrame. |
RotationCurveKey.new
Creates a new RotationCurveKey at a given time with a given CFrame. LeftTangent and RightTangent are left uninitialized and, if not initialized, tangent values of 0 will be used when evaluating the curve.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| time | number | Time at which to create the new RotationCurveKey. | |
| cframe | CFrame | CFrame of the new RotationCurveKey. | |
| Interpolation | KeyInterpolationMode | The interpolation mode for the segment started by this key. Defaults to KeyInterpolationMode.Cubic. |
Properties
| Name | Type / Returns | Description |
|---|---|---|
| RotationCurveKey.Interpolation | KeyInterpolationMode | The key interpolation mode for the segment started by this RotationCurveKey. |
| RotationCurveKey.Time | number | The time position of this RotationCurveKey. |
| RotationCurveKey.Value | CFrame | The CFrame value of this RotationCurveKey. |
| RotationCurveKey.RightTangent | number | The tangent to the right of this RotationCurveKey. |
| RotationCurveKey.LeftTangent | number | The tangent to the left of this RotationCurveKey. |
RotationCurveKey.Interpolation
Defines the interpolation mode used for the curve segment that begins at this key and ends at the next key. Possible values are KeyInterpolationMode.Constant (holds the key's value until the next key), KeyInterpolationMode.Linear (linearly interpolates between this key and the next using spherical linear interpolation), and KeyInterpolationMode.Cubic (uses a cubic hermite spline shaped by RightTangent and the next key's LeftTangent). Defaults to KeyInterpolationMode.Cubic.
Setting this property to a non-cubic mode automatically clears RightTangent (because tangent slope is only meaningful in cubic segments).
| Field | Value |
|---|---|
| type | KeyInterpolationMode |
RotationCurveKey.Time
The time position of this RotationCurveKey along the curve's timeline, in seconds. Keys within a RotationCurve are kept sorted by ascending time; inserting a key at the same time as an existing key replaces the existing key. Defaults to 0.
| Field | Value |
|---|---|
| type | number |
RotationCurveKey.Value
The rotation stored at this key, represented as a CFrame. Only the rotational component of the CFrame is used; the positional component is ignored. Defaults to CFrame.identity.
| Field | Value |
|---|---|
| type | CFrame |
RotationCurveKey.RightTangent
The outgoing tangent (slope) at this key, controlling the shape of the cubic segment that extends toward the next key. Defaults to 0. This property can only be set when Interpolation is KeyInterpolationMode.Cubic; attempting to set it on a key with a different interpolation mode raises a runtime error. Returns nil if the tangent has not been explicitly assigned.
| Field | Value |
|---|---|
| type | number |
RotationCurveKey.LeftTangent
The incoming tangent (slope) at this key, controlling the shape of the cubic segment arriving from the previous key. Defaults to 0. Unlike RightTangent, this property can be set on a key regardless of its own interpolation mode, because the preceding segment may use cubic interpolation and needs a defined slope at its endpoint. Returns nil if the tangent has not been explicitly assigned.
| Field | Value |
|---|---|
| type | number |