Animation Stopping From Tool

I’m wanting to make sure that the running, jumping, falling animations; go over the idle animation when the tool is equipped. No animation but the tool’s idle animation runs. I’ve tried to find solutions on the Developer Forum, but I couldn’t figure it out.

https://gyazo.com/b8bcde427f742da75e6f1aa096361a2a

Here’s the code, it was simple to make.:

local BoStaff = script.Parent
local IdleAnimation = Instance.new("Animation")
IdleAnimation.AnimationId = "rbxassetid://5728410432"
IdleAnimation.Name = "BoIdle"
IdleAnimation.Parent = BoStaff
local plr = game.Players.LocalPlayer
repeat wait() until plr.Character
local Character = plr.Character
local Humanoid = Character:WaitForChild("Humanoid")
local Idle = Humanoid:LoadAnimation(IdleAnimation)


BoStaff.Equipped:Connect(function()
	Idle:Play()
end)

BoStaff.Unequipped:Connect((function()
	Idle:Stop()
end))


I’m also guessing that this might have to do with Animation Priorities, but I haven’t really looked into that yet.

Yes, as you guessed, this is related to priority. The priorities of the default roblox animations are lower than the priority which’s name matches what action the animation animates. I’m not sure if they are all core, but they might be. Because at least some of then are core, your idle animation won’t be completely overridden by them, no matter what you set its priority to be.

So in this situation, you’ll probably need to stop the idle animation when the player moves and start it again when they stop. You could probably check the humanoidrootpart’s velocity or the humanoid’s state (I think RunningNoPhysics might be the state of a humanoid that stands and doesn’t move.) and movedirection to know when to play and stop the animation.

From what I’ve seen you did everything correctly but the only mistake you made is that you animated both of the legs instead of leaving it blank which makes the tool animation with higher priorities overlapped the moving animation leg.

So I fixed this in a way. However, the animation is a little bit, awkward, and I want it to look better when the tool is equipped.
https://gyazo.com/b331601e38e5487d7f499dbf8a9e0dd3