AnimationTrack:GetKeyframeCFrame( Time, RelativeKeyframe )

As a roblox developer, it is currently too hard to convert animation types from CFrame to AnimationTrack and vice versa.

A very useful feature for scripters on roblox would be a new API on AnimationTracks to get a CFrame relative to the HumanoidRootPart for each part in a model; think like a converter from the Keyframe to a Cframe.

Use cases:

  • Legacy support
  • Ability to add in ‘Variable’ Keyframes via CFrame animation (but ease of use with the animation editor) (For instance, the amount of bend in the waist of this guy opening the car door found at this link)
  • Easier to make public and server based animations with the animation editor
  • Easier to code special conditionals into your animations.

Here is a rough sketch of how I think the function should work

  • input:
    Time signature of the desired KeyFrame
    Optional RelativeKeyframe, so basically this would be effectively the last Keyframe’s CFrame. Check the spoiler below.

  • Output:
    A table of each part’s CFrame, relative to the world by default, or relative to the RelativeKeyframe if provided.

More info on RelativeKeyframe argument

Basically, this would be a Keyframe’s CFrame subtracted from the output CFrame (generated from the AnimationTrack and it’s time) to return a delta CFrame that could be used with CFrame:Interpolate() or TweenService to mimic the AnimationTrack’s :Play() function.