Animation not playing via Local Side

I have an animation that I made and published. I try to load it in, but for some reason its length is zero? I decided to open it in AnimationEditor, and the animation is here. I am loading the Animation via LocalScript, that may be the issue.

...
if hum then --hum is defined above
	local animator:Animator = hum:FindFirstChildWhichIsA("Animator")
	if animator then
		local sitTrack = animator:LoadAnimation(script:WaitForChild("ChairSit"))
		sitTrack.Looped = true
		sitTrack:AdjustSpeed(0.5)
		sitTrack:Play()
	end
end

Could be that the animation hasn’t fully loaded yet. To test this out could you print(sitTrack.Length) after you load the animation then wait like 10 seconds to print again.

Like this:

local sitTrack = animator:LoadAnimation(script:WaitForChild("ChairSit"))
		
       print(sitTrack.Length)
task.wait(10)
print(sitTrack.Length)
sitTrack.Looped = true
		sitTrack:AdjustSpeed(0.5)
		sitTrack:Play()

If it’s a loading issue then I recommend either yielding till .Length exist/~= 0 or the more preferred method of preloading the animation way before u actually need to use it.

On mobile so may be typos

Now the length is not zero, but the animation is still not playing. Interestingly, when I print animTrack.IsPlaying it returns true.

You sure the rig is setup correctly? And that the animation is published under the owner of the game?

I said that I published the animation and the rig is built correctly.

That’s weird. Is there any way you can make a repo file that I could test out when I get on my PC (I’ll use on of my own animations for testing)?

Note I’ll prob check it out in the morning cause it’s 1am

Wait, I just created another rig, and it seems to be working on it?

Is any of the parts anchored on ur current rig?

Only the HumanoidRootPart. It works on the second rig with it anchored, though.

Well, I found the issue… My first rig is R15 instead of R6. I use Players:CreateHumanoidModelFromUserId() to create a copy of the player on local side, and it is R15.
Can I somehow turn this rig from R15 to R6?

Oh, I can simply replace it with Players:CreateHumanoidModelFromDescription(<description>, Enum.HumanoidRigType.R6).
Thanks for helping me realise why this happens though.

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