When I press left click, the game detect it, but doesn't play it. This is my first animation, plis, help me.
local Player = game.Players.LocalPlayer Character = script.Parent local Mouse = Player:GetMouse() Mouse.Button1Down:connect(function(Punch) --it works-- local Punch1 = script:FindFirstChild("Punch1") Punch1.AnimationId = "rbxassetid://5436382797" local Humanoid = Character:FindFirstChild("Humanoid").LoadAnimation if Humanoid then local AnimationTrack = Punch:LoadAnimation() --there is the problem -- AnimationTrack:Play() return AnimationTrack end end)
You'll need to load the animation in a humanoid. Lets say there's a Dummy in the workspace, and an animation in the workspace too
local Animation = workspace.Dummy.Humanoid:LoadAnimation(workspace.Animation) Animation:Play()