My animation is not playing

my group animation is not playing, even on the same group, the animation priority is also action (i also tried action4 but still didnt work)

here is the full code

local ItemsModule = {}

function ItemsModule.SetupItemPrompts()
	local ItemsFolder = workspace:WaitForChild("Items")

	for _, displayTool in ipairs(ItemsFolder:GetChildren()) do
		if displayTool:IsA("Tool") then

			local handle = displayTool:FindFirstChild("Handle")
			if not handle then
				warn("Tool missing Handle:", displayTool.Name)
				continue
			end

			-- Display tool cannot be picked up
			displayTool.Enabled = false
			displayTool.CanBeDropped = false
			handle.Anchored = true

			-- Create PromptPart if missing
			local promptPart = displayTool:FindFirstChild("PromptPart")
			if not promptPart then
				promptPart = Instance.new("Part")
				promptPart.Name = "PromptPart"
				promptPart.Size = Vector3.new(1, 1, 1)
				promptPart.Transparency = 1
				promptPart.CanCollide = false
				promptPart.CanTouch = false
				promptPart.CanQuery = false
				promptPart.Anchored = true
				promptPart.Parent = displayTool

				-- Position PromptPart in front of the handle visually
				promptPart.CFrame = handle.CFrame
			end

			-- Create ProximityPrompt if missing
			if not promptPart:FindFirstChild("BuyPrompt") then
				local price = displayTool:GetAttribute("Price") or 0

				local prompt = Instance.new("ProximityPrompt")
				prompt.Name = "BuyPrompt"

				prompt.ActionText = "Buy " .. displayTool.Name
				prompt.ObjectText = "Price: " .. price

				prompt.HoldDuration = 1.5
				prompt.RequiresLineOfSight = false
				prompt.MaxActivationDistance = 10

				prompt.Parent = promptPart

				-- BUY LOGIC
				prompt.Triggered:Connect(function(player)
					local stats = player:FindFirstChild("leaderstats")
					if not stats then return end

					local money = stats:FindFirstChild("Money")
					if not money then return end

					if money.Value < price then
						return
					end

					money.Value -= price

					-- Clone the DISPLAY tool itself
					local newTool = displayTool:Clone()
					newTool.Parent = player.Backpack

					-- Make purchased tool usable
					local newHandle = newTool:FindFirstChild("Handle")
					if newHandle then
						newHandle.Anchored = false
					end

					newTool.Enabled = true

					-- Play animation on tool.Activated
					local animation = newTool:FindFirstChild("Animation") -- or get from ReplicatedStorage
					if animation and animation:IsA("Animation") then
						local playerChar = player.Character
						if playerChar then
							local humanoid = playerChar:FindFirstChildOfClass("Humanoid")
							if humanoid then
								local animator = humanoid:FindFirstChildOfClass("Animator")
								if not animator then
									animator = Instance.new("Animator")
									animator.Parent = humanoid
								end
								newTool.Activated:Connect(function()
									local track = animator:LoadAnimation(animation)
									track:Play()
								end)
							end
						end
					end
				end)
			end
		end
	end
end

return ItemsModule

DETAILS: its a looped animation, R6 posted on the experience’s group, priority Action

in case it helps, the id is rbxassetid://86980976202627

also, sorry if its the wrong category

have you tried turning it on and off

wdym mean exactly? also, it works on equipped, but not on activated

You can insert print() in each section so that you find where the problem occurs before you ask in devforum.

i did, it looks like the animation snippet isnt even running, its a localscript inside the tool
it does print before local animation line

I haven’t done tool animation in a bit, but shouldn’t everything have Anchored = false for animation to work?

I assume then that there’s nothing named Animation under the newTool.

I’d assume an error would show in that case, but you can try printing what ‘animation’ is to see if it’s Nil or not

it gets unanchored after bought (prompt triggered)

-- Make purchased tool usable
					local newHandle = newTool:FindFirstChild("Handle")
					if newHandle then
						newHandle.Anchored = false
					end

atleast there is on studio, and on local, iil try printing none-the-less to see if it prints the right thing

If the animation works in Studio but not in the actual game, the most common cause is ownership or creator mismatch.

Animations must be owned by the same creator as the game. If your game belongs to a group, the animation also needs to be published under that group. Otherwise the animation will load but refuse to play in live servers.

It is also worth double checking that the Animator exists and that the AnimationId is correct. A safe pattern looks like this:

local humanoid = character:WaitForChild(“Humanoid”)
local animator = humanoid:WaitForChild(“Animator”)

local track = animator:LoadAnimation(animation)
track.Priority = Enum.AnimationPriority.Action
track:Play()

Another small but important detail is to set the priority before publishing and then overwrite the existing asset if needed. Changing it locally without republishing will not update the asset that the game is using.

I made a short tutorial that walks through the full workflow from creating the animation to publishing it under the correct creator and playing it in a script: