How can I pause an animation after it concludes?

Hello, I’m playing an animation and I’m attempting to freeze it at the last frame or after it concludes. Though after the animation concludes, the player just goes back to the default animation.

This animation is just the right arm going up

This image is the code to the animation

This is the image of the animation in action, the right arm of the player just goes up

So after the animation plays you want the default animation but with the arm raised?

Yes I want the arm to just stay up

One way would be to copy the default animation and change the arm Position in that one so the arm stays up.
Then have that animation loaded into the game already until you need to use it, and play it after the arm is raised. After the arm is dropped again go back to the default animation.

1 Like

How would I go about copying the default animation and editing it so that the arms already up?

Roblox has all sorts of Tutorials and Documentation (now in the ‘Learn’ tab) if you use the Search tool of the create.roblox.com site.
Just a few of their items, you can probably find more, or learn more of the Properties and how they work by clicking the in-document links:
Scripting Avatar Animations | Documentation - Roblox Creator Hub
Animation in Roblox | Documentation - Roblox Creator Hub
Animate in Roblox | Documentation - Roblox Creator Hub
Animator | Documentation - Roblox Creator Hub

1 Like

To answer your main question though, your code waits until the animation has already stopped, so that probably won’t work. Something like this might work instead:

track:Play()

-- Stop the track once it finishes
track.Stopped:Once(function()
    -- Make sure the track is playing
    if not track.IsPlaying then track:Play() end

    -- Stop the track and make sure the time position is correct
    track:AdjustSpeed(0)
    track.TimePosition = track.Length
end)

I would recommend not trying to pause animations at the very end with any method though, since AnimationTracks don’t replicate when directly modified in some cases.


If your animation is just the arm raising, you can use animation fade to do that. Animation fade is where the playing animation fades from the current one to the new one. You can choose how long the fade takes by doing AnimationTrack:Play(fadeTimeInSeconds).

So to you fade to a similar result:

  • Create an animation with only your final arm position, set it to looped (so it keeps running)
  • When you play it, use :Play(fadeTime), with fadeTime as the amount of time you want it to take for the arm to raise

You can also edit the default toolhold animation which is what some basic tools like this do. If your code goes into the humanoid’s Animate LocalScript, it can replace the animation under “toolhold” or “toolidle” (forgot the name) inside the Animate script of the character with your animation when the tool is inside the character then revert the change when the tool leaves the character. This causes the tool holding animation to be your tool’s holding animation instead of the default one. This doesn’t have a fade option though I don’t think.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.