Problems On Animation Loop On Client And Server Side

I want to loop animation on both the client and server side, but it only loops on the client side. I looked up other similar problems and I followed the solution they had, but it wouldn’t loop on the client side. I made the looping true in the animation editor. I thought animation would be replicated for both the client and server side.

This is the code I used for the local script. It works as I expected it would, but I also tried it in the server script. The animation is not looping. I also change the player or character for the animations.

local Hold = game.ReplicatedStorage.Storage.Animations.Tools.Range["LR-M2_Hold"].Value
local Attack = game.ReplicatedStorage.Storage.Animations.Tools.Range["LR-M2_Attack"].Value

local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://" .. Hold
local holdtrack = localplayer.Character:WaitForChild("Humanoid", 1000):LoadAnimation(anim)
holdtrack.Priority = Enum.AnimationPriority.Action4

local anim2 = Instance.new("Animation")
anim.AnimationId = "rbxassetid://" .. Attack
local attaktrack = localplayer.Character:WaitForChild("Humanoid", 1000):LoadAnimation(anim)
attaktrack.Priority = Enum.AnimationPriority.Action4

1 Like

This has been quite an old problem and it is yet to be fixed by roblox. Animation.Looped = true doesn’t replicate to the server.

A simple fix is to make the animation looped in the animation editor. By doing this the animation will automatically loop and will replicate to the server. You won’t have ro set the .Looped property to true.

Another simple fix can be to run the animation again as soon as it ends but this isn’t recommend as it has some problems.

2 Likes

I have already done that, except for running the animation again when it ends. That is a good hypothesis. I will try that.

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