AnimationTrack.Looped Does Not Replicate

I just spent two hours wondering why my NPC animations were looping but not showing up for the client. The Looped event kept firing which made the problem very confusing. Thank goodness I found this bug report. Please fix this soon; it would make animation code much more intuitive!

8 Likes

This was reported in 2 years ago? Sorry but will this be fixed in anytime soon? The animation still loops after I set it to false by script, and when I call :Stop() on a LoadAnimation after it’s first loop, it won’t stop.

1 Like

I’m at the point where I’m going to have to rethink a certain aspect of gameplay because of this issue.
I get so far as seeing the animations playing for the clients and the server but at some unspecified point in time, the animations will not be seen by the other player or the server, while the client continues to see their animation. I’ve literally battled with this for weeks now :frowning:

3 Likes

Same problem for me as well. I’m surprised this hasn’t been fixed for this long.

2 Likes

This issue is happening to my game as well. Animation is played on the server side and the play properly replicates to the clients, however when I try to stop it from the server side, it only stops on the server and it does not stop on the clients. This was acknowledged as a “known problem” with a “ticket tracking it” over 2 years ago. Where is that ticket now? What is the status on this issue?

2 Likes

This is still an issue today, two years and three months on - there is a work around where you modify it directly in the animation editor but this is a big pain for games where .Looped may be variable (change) - forcing convoluted code.

We were recently trying the fix this issue by running animations on the server instead of the client (assuming this was the issue) but even there it only works server side. Is there any ETA for this engine bug?

2 Likes

This bug still occurs in January of 2021. It’s been 2 years and it still hasn’t been fixed.

A fix I’ve found is to artificially loop the animations once you’ve detected that their duration has expired.

Hoping Roblox is actually intending to fix this issue.

4 Likes

Ridiculous, 2 years and have they’ve even mentioned this?

2 Likes

Yep-still a bug. If Roblox is going to replicate the client’s animations, then replicate everything, including the Looped setting.

1 Like

just a daily reminder that the looped property still doesnt replicate, and it needs to so i dont have to waste hours trying to figure out why the server makes it loop and not the client

2 Likes

Still an issue. Please fix this.

1 Like

The issue is still prevelant, it’s not a huge deal since you can reupload the animations but it’s still a minor inconvience that should be fixed.

Also another interesting occurance is that if you change the animation properties on the server and you tell it to stop, it doesn’t stop previously looped animations changed to non-loop animations.

Code used for the playing NPC animations:

local DanceAnimation = NPC:FindFirstChild("Humanoid"):LoadAnimation(script:FindFirstChild("DanceAnimation"..math.random(1, 5)))
DanceAnimation.Looped = false
DanceAnimation.Priority = Enum.AnimationPriority.Movement
DanceAnimation:Play(nil, nil, 1+(math.random(-1000, 1000)/7500))
local AnimationStopConnection
local function OnAnimationStop()
	AnimationStopConnection:Disconnect()
	if InitalSpawnAttackers == false and NPC:FindFirstChild("Humanoid") and NPC:FindFirstChild("Humanoid").Health > 0 then
		local CurrentPos = table.find(UsedAnimations, DanceAnimation)
		if DanceAnimation then DanceAnimation:Stop() end
		if CurrentPos then
			table.remove(UsedAnimations, CurrentPos)
		end
		DanceAnimation = NPC:FindFirstChild("Humanoid"):LoadAnimation(script:FindFirstChild("DanceAnimation"..math.random(1, 5)))
		DanceAnimation.Looped = false
		DanceAnimation.Priority = Enum.AnimationPriority.Movement
		DanceAnimation:Play(nil, nil, 1+(math.random(-1000, 1000)/7500))
		AnimationStopConnection = DanceAnimation.Stopped:Connect(OnAnimationStop)
		table.insert(UsedAnimations, #UsedAnimations+1, DanceAnimation)
	end
end
AnimationStopConnection = DanceAnimation.Stopped:Connect(OnAnimationStop)
table.insert(UsedAnimations, #UsedAnimations+1, DanceAnimation)
4 Likes

I can confirm this issue is still occurring.

Repro Code:

--[[
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

Repro File:
AnimationTrack.Looped not replicating repro.rbxl (33.2 KB)


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.

4 Likes

Coming up on almost 3 years since this has been reported, and it is still an issue.

2 Likes

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? :heart_eyes:

6 Likes

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.

1 Like

Yup, I’m having the same issue still. Works fine when viewing from server side, but clients are looping.

1 Like

the issue is still here… this is strange

1 Like

The bug is still occurring. I’m so disappointed rn :frowning:

1 Like

Ran into this today, threw me for a loop (hahah :drum:) 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.

4 Likes