Data type
RotationCurveKey
A time-value pair used with RotationCurve instances.
About 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 1
RotationCurveKey.new
(time: number, cframe: CFrame, Interpolation: KeyInterpolationMode)Returns a newRotationCurveKeyat a given time with a givenCFrame.
Properties 5
Interpolation
: KeyInterpolationModeThe key interpolation mode for the segment started by thisRotationCurveKey.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), andKeyInterpolationMode.Cubic(uses a cubic hermite spline shaped byRightTangentand the next key'sLeftTangent). Defaults toKeyInterpolationMode.Cubic.Setting this property to a non-cubic mode automatically clears
RightTangent(because tangent slope is only meaningful in cubic segments).Time
: numberThe time position of thisRotationCurveKey.The time position of this
RotationCurveKeyalong the curve's timeline, in seconds. Keys within aRotationCurveare kept sorted by ascending time; inserting a key at the same time as an existing key replaces the existing key. Defaults to0.Value
: CFrameTheCFramevalue of thisRotationCurveKey.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 toCFrame.identity.RightTangent
: numberThe tangent to the right of thisRotationCurveKey.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 whenInterpolationisKeyInterpolationMode.Cubic; attempting to set it on a key with a different interpolation mode raises a runtime error. Returnsnilif the tangent has not been explicitly assigned.LeftTangent
: numberThe tangent to the left of thisRotationCurveKey.The incoming tangent (slope) at this key, controlling the shape of the cubic segment arriving from the previous key. Defaults to
0. UnlikeRightTangent, 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. Returnsnilif the tangent has not been explicitly assigned.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.