Tool animation breaks the walk/run animation

I made a tool animation for the flashlight and there is custom animations but if I equip the tool the animations glitch and the flashlight moves with the arm when running instead of staying up like the animation is supposed to do

video: https://gyazo.com/478fe534b49815f01caaccc51c7a2640
flashlight animation: https://gyazo.com/1eb02f70ed2b9c571f520197dfe16e3a

Most likely has something to do with the animations priority.

Information here:
https://developer.roblox.com/en-us/api-reference/class/Animation
https://developer.roblox.com/en-us/api-reference/property/AnimationTrack/Priority

the flashlight animation priority is action and I tried action2 but that also didn’t work

do you mind sending your code?

local tool = script.Parent
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/Asset?ID=10938319864"
local track
tool.Equipped:Connect(function()
    track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
    track.Priority = Enum.AnimationPriority.Action
    track.Looped = true
    track:Play()
end)
tool.Unequipped:Connect(function()
    if track then
        track:Stop()
    end
end)
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/Asset?ID=10938319864"
anim.Parent = script.Parent.Parent
local track = script.Parent.Parent.Humanoid.Animator:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action2
track.Looped = true

tool.Equipped:Connect(function()
	track:Play()
end)
tool.Unequipped:Connect(function()
	track:Stop()
end)

try using this, simplifying the code a bit.

also, Humanoid:LoadAnimation is deprecated! Switch over to using Humanoid.Animator:LoadAnimation

ohh i see now it works thanks
char limit char limit

To explain your issue you were loading and subsequently playing a new animation track instance each time the tool’s ‘Equipped’ event/signal was fired.