I cannot get an animation to play, but everything else works just fine

Hello, I am trying to make a script where if you activate a tool, it will make an animation play, but the animation does not seem to play, and I do not know why.

local mouse = game.Players.LocalPlayer:GetMouse()
local p = 0
local animation = game.ReplicatedFirst.Animation
local char = game.Players.LocalPlayer.CharacterAdded:Wait() or game.Players.LocalPlayer.Character
local humanoid = char:WaitForChild("Humanoid")
local animator = humanoid.Animator
local DownAnim = animator:LoadAnimation(animation)
	





tool.Activated:Connect(function()
	p = p + 1
	print(p)
	local DownAnim = animator:LoadAnimation(animation)
	DownAnim:Play()
end)```

This is in a local script that is in a tool. P exists because I am making a system where it sends a remote event to a server, but my main issue is that the animation won't play, do I use a different animation priority? I think I have it as a core animation right now, I tried using others but they don't work, "p" is equal to the correct thing but the animation just doesn't play, and i dont know why, can someone please help me?
1 Like

The animation priority is supposed to be Action - Action4.
Core animations will basically never run unless all other animations are stopped, which never happens since the Idle animation starts.

Thank you so much for helping me, I have spent hours on end trying to figure this out, thank you so much

1 Like

Good thing it helped you!
I hope to help many other people in the future as well.