When playing the same animation through .Stopped, the animation does not visually play. I’m not the best with my words, but I have code examples for replication.
Below, I used the following code, which is a basic replica of how my game handles attacks/animations.
local RepeatLimit = 0
local Animator = workspace.Sweet_Smoothies.Humanoid.Animator
local Anim = workspace.Animation -- Insert any unlooped animation here
local Event = Instance.new("BindableEvent")
Event.Parent = workspace
local Connection = nil
Connection = Event.Event:Connect(function()
RepeatLimit += 1
if RepeatLimit >= 4 then
Connection:Disconnect()
Event:Destroy()
return
end
local Track = Animator:LoadAnimation(Anim)
Track:Play()
Track:GetMarkerReachedSignal("End"):Once(function() -- This can be any marker in the animation.
Track:Stop(.3)
end)
Track.Stopped:Once(function()
Track:Destroy()
Event:Fire()
end)
end)
This code yields in this result. Notice how the second/third animations don’t appear at all (animation events still run).
Expected behavior
The wanted outcome would be the following:
This can be achieved if I move Event:Fire() into the :GetMarkerReachedSignal function rather than the .Stopped function. This may be just me not knowing enough about the engine, but I’d like to know if this behavior is intended. Otherwise, I’d like to find a workaround if possible!
Note: The workaround with Event:Fire() I found only works if the line is placed BELOW :Stop(.3), not above.