CurveAnimation

Show Deprecated

CurveAnimation is a subtype of AnimationClip consumed by Roblox's animation system. It stores animation data for each animated channel in a Rig as a separate, individual curve. For example, CurveAnimation stores the Position channel for an articulated joint as Vector3Curve, and it might store the Rotation channel as an EulerRotationCurve or a RotationCurve.

CurveAnimation structure

CurveAnimation stores curves in a hierarchical manner, matching the hierarchy of the structure of Motor6Ds or Bones in the animated model. Under each CurveAnimation instance lies a hierarchy of Folder instances representing animated joints in the model. Under each such folder instance, several possible instances may exist. An instance named 'Position' of type Vector3Curve can drive the local translation of the Motor6D or Bone on the animated model. Similarly, an instance named 'Rotation', of type either EulerRotationCurve or RotationCurve can drive the local rotation of the Motor6D or Bone on the animated model.

Partial matching of hierarchy

You can match partial hierarchies to a model when playing a CurveAnimation in Roblox's animation system. This means that not all joints need to be present in the hierarchy for the joints that are present to apply properly. Furthermore, you can match hierarchies in a 'relative' manner. For example, a CurveAnimation's first Folder instance root can be UpperTorso, and the animation system matches that to any existing sub-hierarchies in the model.

Animating miscellaneous channels

Curve Animations can also animate other numerical values in a model. For example, you can animate FACS controls for facial animations by creating a folder under the CurveAnimation instance named after an existing FaceControls instance in the model. Then, to animate individual facial controllers, you can store individual FloatCurve instances named after the animated FaceControls property.

Using CurveAnimation when making animations

As for other AnimationClip types (such as KeyframeSequence), you must upload CurveAnimations to Roblox first before playing them. To do that, right click on the CurveAnimation and click 'Save to Roblox'. Alternatively, use Plugin:SaveSelectedToRoblox() to bring up the animation upload window.

If you want to preview an Animation before uploading it to the Roblox site, you can generate a temporary id using AnimationClipProviderProvider:RegisterAnimationClip. This generates a hash id that you can use for localized animation testing.

Obtaining CurveAnimations

As for other AnimationClip types (such as KeyframeSequence), if you want to download the CurveAnimation corresponding to an existing uploaded Animation using Lua scripts, use AnimationClipProvider:AnimationClipAsync.

Summary

Properties

Properties inherited from AnimationClip

Properties

Methods

Events