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')

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')

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

Same thing. Its till only doing it once

is that for a NPC ?

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

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

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

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

1 Like

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

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

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

2 Likes

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