So I'm making a shooter game and I'm making a reload animation, however when you reload the animation suddenly stops if you try to walk or do any other action. if you stay still it sometimes works but if the second idle animation plays, the reload animation stops again. How do I prevent this from happening? I don't want any leg animations to be overridden by the reload animation, only the arms should be overridden by the reload animation.
(THE LOCAL SCRIPT THAT RUNS THE ANIMATION)
anime = script.Parent.Animation
debounce = false
function play (dah)
if debounce == false then
local hum = game.Players.LocalPlayer.Character.Humanoid
local anim_feet = hum:LoadAnimation(script.Parent.Animation)
local current = anim_feet
local hum = game.Players.LocalPlayer.Character.Humanoid
local animation = anime
local animationLoad = hum:LoadAnimation(animation)
animationLoad:Play()
debounce = true
wait(1.5) --how long the animation lasts
debounce = false
current:Stop()
end
end
script.Parent.Activated:Connect(play)
helpfull info: the local script is inside a tool. sometimes when you keep walking the reload will still play, however if you stop walking , the reload animation stops too.

1 comment
I just noticed you define hum twice, there is no need for that since you are not changing the value. Also why do you define the same animation as both animationLoad and current? And why do you stop a not running animation (current)?