How to scalably stop animations right before they end to preserve the pose

I want to preserve the pose that the animation moves the player into after the animation has completed, then be able to whenever I desire to finish the animation and return back to normal positioning.

I read the above post, but it was to no avail because I already have a lot of made animations that cannot scalably be remade with the extra keyframe.

2 Likes

You could possibly Connect on GetPropertyChangedSignal for TimePosition and check if it’s very close to the total Length of the animation, if so then stop it:

local Close = 0.05
AnimTrack:GetPropertyChangedSignal("TimePosition"):Connect(function()
    if (AnimTrack.Length - AnimTrack.TimePosition) <= Close then
        AnimTrack:Stop()
    end
end)

This looked very good, but I have the unusual problem of GetPropertyChangedSignal not working on TimePosition? Not sure why.

I believe unfortunately this may be one of the properties that GetPropertyChangedSignal doesn’t support.

Shucks, you may have to wait out the AnimTrack.Length minus some offset and then stop it - thought wait has unpredictablities and won’t exactly wait correctly.

As you might fear, a extra Keyframe at the end along with a GetMarkerReachedSignal Connection is the better solution.

Would there be any way to mass-update my animations to add this keyframe?

The simplest way would be to:
Import the Animation => Copy the last Keyframe => Paste it near the end => Name it => Export the Animation.