Animation wont play but debugs work

Id like an animation to play when the player activates the tool, but the animation will not play. Id love some help!

I already tried its animation priority and that didnt work.

local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid)

local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://136075368851428"
local track = animator:LoadAnimation(animation)

script.Parent.Activated:Connect(function()
	if not track.IsPlaying then 
		track:Play() 
		print("Animation playing")
	end 

end)

script.Parent.Unequipped:Connect(function() 
	if track.IsPlaying then 
		track:Stop() 
	end
end)```

If it doesnt play you can try changing animation priority or you have uploaded it to a wrong group.

local Players = game:GetService("Players")

local Plr = Players.LocalPlayer::Player

local char:Model = Plr.Character or Plr.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")::Humanoid
local animator:Animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid)

local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://136075368851428"
local track = animator:LoadAnimation(animation)
track.Priority = Enum.AnimationPriority.Action

local tool:Tool = script.Parent

tool.Activated:Connect(function():()
	if not track.IsPlaying then 
		track:Play() 
		print("Animation playing")
	end 

end)

tool.Unequipped:Connect(function():()
	if track.IsPlaying then 
		track:Stop() 
	end
end)

are you sure that the animation ID is correct? and if so, is it uploaded on a different account or group than the one that owns the game?

positive its correct and i published it myself

is it uploaded on the same account/group that owns the game?

yeah i own the game and i published the animation associated with that ID

i uploaded the animation and game, and it still wont play when adding these changes.

Please insert print() in script.Parent.Activated:Connect() and test again.

Theres already one there, :smiley:

prints just fine!

Did you check this? : If the Animator is not a descendant of a player character, its animations must be loaded and started on the server to replicate.