Animation in tool keeps stopping

I am trying to make an animation constantly play when I equip this camera tool. The animation works when I equip it, but then it stops working and goes back to hands down. I want it to keep playing as long as the tool is out.

Here is a video of what is happening:

And here is the code in the animation script in the tool:

local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local h = char:WaitForChild("Humanoid")
local anim = h:LoadAnimation(script.Parent:WaitForChild("Hold"))

local tool = script.Parent

tool.Equipped:Connect(function()
	anim:Play()
end)

tool.Unequipped:Connect(function()
	anim:Stop()
end)

Do you have set up the animation priority and looping correctly?

image

for the priority and

image

for looping.

Yes when I made the animation, I looped it correctly, that’s fully working. What do you mean by animation priority?

Should be visible from the screenshot I provided. Whenever you have an animation that has low priority, the default Roblox animations, such as walk animation, will overwrite them.

So what should I set it as if I want it to have the highest priority?

Action is the highest priority possible, I would suggest using that. It’s the one I selected on the screenshot.

Alright, I’ll try that. Thanks.

1 Like

You have to export the animation again of course. Hope it will work.

It worked, thank you :pray: This has been a problem on many of my games.

1 Like