--[[
Repro Instructions:
- Create a R15 rig
- Create a Script and parent it to the rig
- Add this code to the script
- Play test: Compare results on the client and the server
]]--
local newAnimation = Instance.new("Animation")
newAnimation.AnimationId = "http://www.roblox.com/asset/?id=507770239" --Default Roblox wave animation. Looped is set to true initially.
local newAnimator = Instance.new("Animator")
local humanoid = script.Parent.Humanoid
newAnimator.Parent = humanoid
local animationTrack = newAnimator:LoadAnimation(newAnimation)
animationTrack.Looped = false --Looped is set to false on the server
-- Expected behavior: Wave animation plays, stops, then about five seconds later plays again.
-- Actual behavior on client: Wave animation loops, resetting when AnimationTrack:Play() is called. Calling AnimationTrack:Stop() doesn't stop the animation on the client.
-- Actual behavior on server: Expected behavior.
while true do
animationTrack:Play()
print("Animation played!")
animationTrack.Stopped:Wait()
print("AnimationTrack.Stopped on server!")
--Using AnimationTrack:Stop() as a work around doesn't work:
animationTrack:Stop() print("Tried to force animation to stop with AnimationTrack:Stop()!") --This code doesn't stop the animation on the client.
wait(5)
end
While this bug isnât very hard to work around (animations can be reuploaded), I think this should at least be mentioned in the AnimationTrack.Looped page of the wiki to inform developers.
LOL never realized it was a bug. Ive tried using .Looped for well over a year, failing, and thinking I was doing something wrong. Turns out itâs just broken.
Roblox, how about you fix this bug after 3 years?
Please fix this. Right now I have to create a system, whenever a looped animation gets turned on it has to send a remote signal to all clients to play an animation for that certain rig.
Ran into this today, threw me for a loop (hahah ) until I eventually found this thread. My serverside NPCs were animating properly on the server, but not the client.
Kinda silly that this doesnât replicate. It is not intuitive at all. This is very frustrating when youâre using animations you didnât create (Roblox emotes namely) - as you canât easily loop them without some weird and tedious workarounds.
Adding on to this, could it at the very least be marked on the documentation that AnimationTrack.Looped doesnât replicate? This has been happening for 3 years, it seems like at this point it should just be made official.
Damn. Didnât think I would be stumped by a 3 year old bug spent the last few hours trying to figure out why my animations werenât looping. At least Iâve got closure as to why they werenât
This is still a problem. Are there any updates on this? Itâs been nearly 4 years⌠this is an incredibly inconvenient bug that makes working with humanoids & animations on the server-side quite a headache.
For the ones that are in need of this property and donât know what to do, here are some work arounds:
Work around 1:
while true do
AnimationTrack:Play()
AnimationTrack.Stopped:Wait()
end
Work around 2:
Go directly to the animation editor and set the animation to loop, then just go to the game and call Play (the animation will literally just loop).
From a user perspective, the engineering work required to fix/add a feature is more often than not very deceiving. Things you expect to take a large workload actually donât, and things that seem easy to fix might be caused by a very deep engine implementation that canât be easily changed.
For bug reports, itâs best to argue in terms of the impact it has on you as a developer to have it resolved. Itâs not really constructive to talk about âeffort to fixâ, because we simply canât reason about it, nobody here actually knows.
Itâs definitely true that when bugs have a good(!) workaround, there is less of an incentive to resolve the issue if there are other pressing matters going on. But I donât think either of those workarounds is particularly satisfying. The second one seems good but it inhibits you when you need the same animation both looped and non-looped.
Animation replication is different from all other replication IIRC. When you play an animation from the server multiple times, you actually get separate tracks each with their own animation object on the client.
As above, itâs not always as straight forward as you think, and itâs pointless to argue about engine internals since nobody knows. Focus on impact the issue has on you if you want it resolved more quickly.
We are working on improvements to the animation replication system that should resolve this issue. Unfortunately, those improvements are taking longer than expected as we donât want to break any existing functionality. We are continuing to work on this, though and we hope to release it as soon as it is working well.
Core priority animations seem to replicate properly.
For anyone else if the animation doesnât have to be a higher priority this seems to be the solutuion