Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why wont this loaded animation play?

There is no error when the tool is activated, but the animation wont play?

script.Parent.Activated:connect(function()
	local anim = script.Parent.Swing
	local loadedanim = script.Parent.Parent.Humanoid:LoadAnimation(anim)
	loadedanim:Play()
end)

1 answer

I don't understand why people keep on doing this but Humanoid is NOT a child that LocalPlayer has. You might not receive that error because something must have happened to your studio or you just didn't notice it/find it.

My recommendation is adding ".Character" before the ".Humanoid" part. I'm assuming you are using a local script in "StarterPlayerScripts".

local loadedanim = script.Parent.Parent.Character.Humanoid:LoadAnimation(anim)

This tells the computer to go the player's character and get the "Humanoid" child.

If you have any problems or questions please contact me. ;)

This discussion is preserved as it was. New answers, comments, and votes are closed.