Any help with equipping and changing an animation?

So I have this equip part of my script where it gives the idle, but I need it to change the run anim, any help because this is for some reason not working, any its not giving a print either.

TOOL.Equipped:Connect(function()
	local HUM = TOOL.Parent:FindFirstChildOfClass("Humanoid")
	if HUM and script:FindFirstChild("Idle") then
	TOOL.Parent.Animate.run.RunAnim.AnimationId = "http://www.roblox.com/asset/?id=3394630952"
	print("gave run anim")
		IDLEANIM = HUM:LoadAnimation(script.Idle)
		IDLEANIM:Play()
	end
end)
1 Like

The only reasons I can think of for the print not working are:

  • Script is disabled (highly unlikely)
  • Script does not have an Idle child (make sure it does!)
  • The TOOL.Parent.Animate.run.RunAnim.AnimationId = ... line errors

Are there any errors?

What is the expected behaviour?

1 Like

No behaviors, but the idle animation does load in, im not sure if it has an idle child, but seeing as it gives the idle animations, it does.

1 Like

So I just made an adjustment, and it now gives the run anim, but now i have a new issue, the run anim does not show up, how do I make this work? And also, I made the “idle” anim an idle property in the animation editor, and it now had my right arm sticking out, and the run does even show up when I move.

1 Like

Might be related to the animation priority.

You should try tweaking with the animation priority, it might fix your problem.

I’d recommend switching it to Action.

1 Like

The run or the idle? character30

1 Like

Would it be better for me to just send you the tool and you can try it for yourself?

1 Like

Roblox’s default animations all run on the ‘Core’ priority. If you want to play animations without having them overridden by the default animations, you need to increase their priority to something above ‘Core’. Make sure to re-export the animation after changing its priority.

2 Likes