I can send rest of the script if its necessary, but there were irrelevant parts.
I need to ensure that one animation starts the moment when other one finishes, but as you can see in the example, there’s a strange pause between the animations.
The animation is suitable for a seamless frame-by-frame transition, but when we test it in the game, we don’t get the correct results.
one error though is that the :Connect will keep playing the dance animation if it never gets disconnected
it should be replaced with :Once or :Wait
DummyAnimTracks["Cheer"..i]:Play()
DummyAnimTracks["Cheer"..i].Ended:Once(function()
DummyAnimTracks["Dance"..i]:Play()
end)
-- or could be wait, in a separate thread if needed
DummyAnimTracks["Cheer"..i]:Play()
DummyAnimTracks["Cheer"..i].Ended:Wait()
DummyAnimTracks["Dance"..i]:Play()
Perhaps you should try to use .Stopped() instead of .Ended()
There is a slight difference between the two, which you can look into at the official docs. https://create.roblox.com/docs/reference/engine/classes/AnimationTrack .Ended is fired when the animation is FULLY completed, meaning the subject returns back to its neutral pose. While .Stopped is fired when the animation itself finishes (means at the end of the timeline). You can also try adding your own transitions without using the .Stopped() listener.