Animator not loading an animation

For some reason this is not working, the following is inside a local script.

tool.Equipped:Connect(function()
	local animator = game.Players.LocalPlayer.Character.Humanoid.Animator
	animator:LoadAnimation(tool.Animator.Equip):Play()
	
end)

The animation itself is inside a folder which is inside the tool itself which is being equipped, not sure why it’s not loading. I tried debugging by printing the animator and the animation, however both returned the correct instances, so it must be a problem with the ‘animator:LoadAnimation()’. Any help is appreciated, thanks.

Is this a LocalScript?

char limit

1 Like

yeah, not sure why it’s not working though

Did you place the Animator in the tool? And also I don’t think Animator has a property called Equip.

Equip is just the animation’s name, and the Animator as seen in the loadanimation parameters is the folder which it’s in. The animator which loads the animations is still in it’s usual place within the humanoid. Thank you for trying to help me

Try putting that :Play() inside the functions parentheses.

what’s the animation priority you set for the animation? is it set to idle since you want to play it while the tool is equipped

is that animationID yours!
does it loop?

I think I know the solution, as I faced something exactly like it.
Unless there are errors in the code, you might want to check whether the animation is R6 or R15 and then change your game settings to load in characters like that.

I don’t think that will work since you have the function creates an animation track, but thanks for trying

I believe that the animation priority is set, and a friend who I’m developing a game with created the animation while on team create with me

I’ll try that, thank you for the response

The problem was for some reason caused by the animation itself, for some reason ROBLOX didn’t like the fact that we were uploading the animation on the same team create game that it was being made on.
In the end, we had to upload the animation on a separate, non-team create place and then the animation worked.

1 Like