Roblox Animation loops on server but not on client

I hope this is the right category as I have to loop the animation with a script. I am using the ROBLOX Point Animation and for some reason it will loop the animation on the server, but not on the client (it only plays once on the client). However, other ROBLOX animations I have used, like the Confused Animation and the Wave Animation, loop on both the Client, and the Server.

Script used for all animations:

local animation = script:WaitForChild('AnimationID')
local humanoid = script.Parent:WaitForChild('Humanoid')
local dance = humanoid:LoadAnimation(animation)
dance:Play()
dance.Looped = true

image

These animations use the same code, its just a different animation (obviously) but they still loop on both the client and server:


However, the point animation will not loop on the Client, only the Server.

How can I fix this? It is Roblox’s animation, but how can this one not loop but the others do?

(I have looked at other topics similar to this, but they involve custom animations that can be looped from the animation editor. I don’t know much animating so I don’t know how to fix this issue with Roblox animations)

Maybe try

local animation = script:WaitForChild("AnimationID")
local Animator = script.Parent:WaitForChild("Humanoid"):WaitForChild("Animator")
local Track = Animator:LoadAnimation(animation)

Track.Looped = true
Track.Priority = Enum.AnimationPriority.Idle
Track:Play()

  1. Make it loop before hand as maybe the script isn’t fast enough to create the loop in time
  2. Using the animator object instead of the humanoid

I tried that but no luck sadly. The script works just fine with other animations but for some reason I am having an issue with this one. It kept looping for Server, but not Client.

maybe own the animation

game:GetObjects("http://www.roblox.com/asset/?id=ANIMATION ID GOES HERE")[1].Parent = workspace

this gets the animation aslong as you have the ID, no matter who owns it an export it then paste it

Try setting the Looped property before you play the animation if that doesn’t work then just loop, or if you don’t want to manually do that you can just retrieve the animation and publish it looped, preferably set the priority to Action incase the character/npc gets moved.

This is how I would do it if I wanted to loop it manually.

local animation = script:WaitForChild('AnimationID')
local humanoid = script.Parent:WaitForChild('Humanoid')
local dance = humanoid:LoadAnimation(animation)

while true do
    dance:Play()
    dance.Stopped:Wait() -- I forgor if it's stopped or ended just try the other one if this one doesn't work xd
end
1 Like

Animation properties don’t replicate. If you want to change an animation’s property, you need to do it from the animation itself before exporting.

2 Likes

Thank you, this works! It plays on Client and Server now.

1 Like

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