Animation not playing on mouse click

Hello! So I’m trying to make it where when the player clicks an swing animation plays. But when I click the animation doesn’t play. There are no errors in the output.

Here is my code:


wait(1)

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character.Humanoid
local Mouse = Player:GetMouse()

Mouse.Button1Down:Connect(function()
	
	local Track = Humanoid:LoadAnimation(script.SwingAnim)
	
	Track:Play()
	
end)

Sorry for the trouble and thanks for the help!

Ignore this post I figured it out lol sorry!

1 Like