AnimationTrack.Looped Does Not Replicate

Yes, this is a known problem and we currently have a ticket tracking it. Hopefully we will get to it soon.

23 Likes

This issue is still a thing and it’s currently very frustrating to make a somewhat hacky solution. Do you guys have a possible ETA on when this issue will be resolved?

8 Likes

@UP, It’s very upsetting. Will we ever get a fix?

5 Likes

This is STILL an issue, very frustrating.
There is a workaround though, make two identical animations, one with looped property in the Editor ticked. Is there any update on this?

[CC: @CodeWriter ]

AdjustSpeed also doesn’t work :broken_heart:

4 Likes

We use AnimationController and Looped does not replicate.

function module:playAnimation(Animation,fadeTime,weight,speed,loopAnimation)
    local fadeInTime = fadeTime or self.defaultFadeInTime
    local weight = weight or self.defaultWeight
    local speed = speed or self.defaultSpeed
    local loopAnimation = loopAnimation or true
    local AnimationTrack = self.Animations[Animation] or error("playAnimation Error. Could not find 
    loaded animation: " .. Animation)
    self.Animations[Animation].Looped = true
    AnimationTrack:Play(fadeInTime,weight,speed)
    table.insert(self.activeAnimations,Animation)
end

Unfortunately it looks like this is still a problem, as the Looped does not replicate.

1 Like

Animation.Looped still doesn’t replicate in June 2020, this bug causes a massive barrier and annoyance for developers of games with many animations (like my own) as each animation has to be uploaded 2 different times (looped + non-looped) to achieve the behavior that should be provided by the .Looped property. Be sure to let us know if you have any updates on this as it’s still ongoing and not fun to work around.

10 Likes

Another vouch for this problem. It has caused me a lot of confusion. While the animation has stopped on the server sided, the client is still running it. The file attached is the one used to create the gif.

AnimationTrackReplication.rbxl (28.2 KB)

3 Likes

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