Class · inherits Instance
RotationCurve
Represents a sequence of rotations and the interpolation curve between them.
About RotationCurve
This class holds a sorted list of
RotationCurveKeys that represent a sequence of
rotations. The shape of the interpolation curve between two keys is determined
by the RotationCurveKey.Interpolation type.
Properties 1
Length
: intReadOnlyNotReplicatedNumber of rotation keys in this curve.
Methods 7
GetKeyAtIndex
(index: int) → RotationCurveKeyReturns a copy of a key at a given index.GetKeyIndicesAtTime
(time: float) → ArrayReturns the index of the last and first key of a period of time.The first item in the returned array is the index of the last key with time less than or equal to
time(or the lesser of either 1 or the curve length if no key was found). The second item in the returned array is the index of the first key with time greater than or equal totime(or the curve length if no key was found satisfying the inequality).GetKeys
() → ArrayReturns a copy of all the keys in the rotation curve as a Luau array ofRotationCurveKeys.GetValueAtTime
(time: float) → CFrame?Samples the rotation curve at a given time and returns the corresponding rotation as aCFrame.Samples the rotation curve at a given time and returns the corresponding rotation as a
CFrame. Empty rotation curves are evaluated asCFrame.identity.InsertKey
(key: RotationCurveKey) → ArrayAdds the key passed as an argument to this curve. If a key at the same time is found, it will be replaced.Adds the key passed as an argument to this curve. If a key at the same time is found, it will be replaced. In the returned array, the first value is
trueif a key was added orfalseif a previous key was replaced; the second value is the index at which the marker was added.RemoveKeyAtIndex
(startingIndex: int, count: int = 1) → intRemoves a given number of keys starting from a given index.Removes a given number (
count) of keys starting from thestartingIndexindex and returns the number of keys that were removed.SetKeys
(keys: Array) → intResets this curve's keys using theRotationCurveKeyarray passed as an argument.Resets this curve's keys using the
RotationCurveKeyarray passed as an argument. Keys in thekeysarray are sorted in ascending time order before insertion, and keys at duplicated times are removed in a stable manner.Returns the number of keys actually inserted. Keys previously stored in this curve are removed before the keys passed as arguments are added.
RotationCurve also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.