How to check if an AnimationTrack reached the End

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    On my Fist FPS System. When you Equip the Tool. An animation plays. When it reaches the end, it will play an Idle Animation

  2. What is the issue? Include screenshots / videos if possible!
    I do not know how to check if it is at the End.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve tried doing an if statement to check the Track’s IsPlaying property is false

Animations have priorities, allowing one animation to temporarily override another. Use this to your advantage as animations run once then stop unless told to do otherwise via script.

Is there any way to Change this in the AnimationTrack or is there suppose to be another way

It’s changeable via script and animation editor.

Can you show an Example on Script

Note that you seem to only be able to change the priority if the animation is loaded into a humanoid.
local A = workspace.Test.Humanoid.Animator:LoadAnimation(Instance.new(“Animation”))

A.Priority = Enum.AnimationPriority.Idle --"Idle" can be changed to 3 other priorities

Further information in this link if wanted:
AnimationTrack.Priority (roblox.com)

Nvm, I found a Property on the API for AnimationTrack called Priorty

u can use AnimExample.Stopped:Wait() then play the idle anim after

animationTrack.Stopped:Connect(function()
    print("ended")
end)
1 Like