Why is my animation not looping

I have loaded an animation.
I then set it to loop.
But it is not looping, Can anyone tell me why it might be?

local function loadCharacter(charName)
	local char = game:GetService('ServerStorage'):FindFirstChild('Characters'):FindFirstChild(charName):Clone()
	
	
	
	
	char.Parent =workspace
	
	local anim = char.Humanoid:LoadAnimation(script:FindFirstChild('Anim'))
	
	anim.Looped = true
	anim:Play()
	
end

wait(1)
loadCharacter('Dummy')
1 Like

try this

local function loadCharacter(charName)
	local char = game:GetService('ServerStorage'):FindFirstChild('Characters'):FindFirstChild(charName):Clone()
	
	
	
	
	char.Parent =workspace
	
	local anim = char.Humanoid:LoadAnimation(script:FindFirstChild('Anim'))
	
	anim.Looped = true
    task.wait()
	anim:Play()
	
end

wait(1)
loadCharacter('Dummy')
1 Like

Humanoid:LoadAnimation() is deprecated, It still works, but it is a bad practice to use deprecated code.
Animator | Roblox Creator Documentation

1 Like

Same thing. Its till only doing it once

1 Like

is that for a NPC ?

1 Like

Yes it is for an npc. Why do you ask?

1 Like

On keyframesequences, set the Looped property to true. (It should be visit when you load an animation on a dummy using any animation editor).

1 Like

just asked it, I did some searching and found out that there is a bug setting .looped from a script.

1 Like

I looked at this it says it only does this if you do it on the server. And then change it to client and do something there. Im just doing it straight from the server.
Unless I read it wrong ofc

2 Likes

load the animation in roblox anim efitor and set looping to true that will 100% fix it

1 Like

How do I set looping to true? I kind of new to animating

1 Like

im not sure where the button is, havent used the animator for some time. it should be a round arrow with a play icon inside

3 Likes

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