Animation doesn't play when speed is negative

I am playing 2 animations back to back: ShowTrack and OpenTrack
When ShowTrack reaches the marker "StartPosition" I want it to stop the animation and play OpenTrack in reverse. This works perfectly with normal speed, but is completely broken with reverse. When playing in reverse speed the second animation is stuck at the last frame (first when playing in reverse), but everything works OK when the speed is positive

Code that works perfectly:

ShowTrack:GetMarkerReachedSignal("StartPosition"):Connect(function()
	ShowTrack:Stop(0)
	ShowTrack.Looped = false
	OpenTrack.Looped = false
	OpenTrack:Play(0 , 9, 1)
end)

Code that is stuck at the first frame:

ShowTrack:GetMarkerReachedSignal("StartPosition"):Connect(function()
	ShowTrack:Stop(0)
	ShowTrack.Looped = false
	OpenTrack.Looped = false
	OpenTrack:Play(0 , 9, -1)
end)

When the play speed is set to -1 everything breaks, what can I do?

1 Like

Try putting OpenTrack.Looped = true when putting the speed at -1

1 Like

I tried that before - no results

1 Like

Huh… i tried with an animation i have and it has Animation Events and it works fine, can you tell me what you need it to be reversed for?

Instead of modifying the playback speed, you should be using :AdjustSpeed instead to -1 to play the animation backwards

ShowTrack:GetMarkerReachedSignal("StartPosition"):Connect(function()
	ShowTrack:Stop(0)
	ShowTrack.Looped = false
	OpenTrack.Looped = false
    OpenTrack:AdjustSpeed(-1)
	OpenTrack:Play(0,9)
end)

That just plays it normally, running :AdjustSpeed() before playing does nothing

I play the animation before but in the normal speed, then I want to reverse things into how it was before so I use that - also I don’t want to mess around with uploading 10 different animations

I dont really know what it is… but try to place the OpenTrack:AdjustSpeed under the play.
If that dosnt work then try playing the game on roblox and see if it works in the real game.

it could be your roblox studio, if it is, then try to reinstall studio, if that dosnt work, then it might be a bug, idk…

In a nutshell, once you play an animation track you can’t play it again in reverse and have to create a new animation track because roblox breaks it for some reason - just doing :AdjustSpeed doesn’t work

ShowTrack:GetMarkerReachedSignal("StartPosition"):Connect(function()
	ShowTrack:Stop(0)
	local NewAnimationTrack = Animator:LoadAnimation(OpenAnimation)
	NewAnimationTrack:Play(0,9,-1)
end)

huh, thats weird… but nice you that you found a solution for it!

1 Like

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