Hi, I’m trying to figure out a way to allow the animation to keep on playing, even when you are moving. For some reason, the animation stops when I move, or bump into something. If I’m moving and click on the tool, the animation will run normally. If I’m still, the animation works fine. It doesn’t work/stops working as soon as I start moving.
game.Players.LocalPlayer.Character is a bigggggg no no.
The character could possibly not be loaded or something, so I’d do this.
Also, a more efficient way to stop all running animations in the character is in the script below in the Unequipped function.
script.Parent.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
local Hum = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
animation = Hum:LoadAnimation(script.Parent.Animation)
animation:Play()
end)
end)
script.Parent.Unequipped:Connect(function()
local AnimationTracks = humanoid:GetPlayingAnimationTracks()
for i, track in pairs (AnimationTracks) do
track:Stop()
end
end)``