Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My animation is not playing? 'Play is not a valid member of Animation'?

Play is not a valid member of Animation

local player = game.Players.LocalPlayer
local Char = player.CharacterAdded:Wait()
local Humanoid = Char:WaitForChild("Humanoid")

local anim = script.Parent:WaitForChild("EquipAnimation")
print(anim)

Humanoid:LoadAnimation(anim)

script.Parent.Equipped:Connect(function()
 if anim then
  anim:Play()  -- Error is on this line
 end
end)

If someone spots anything, please tell me!

1 answer

✓ Accepted answer

The LoadAnimation needs to be declared a separate variable that must be played.

LoadedAnim = Humanoid:LoadAnimation(anim)
LoadedAnim:Play()

This discussion is preserved as it was. New answers, comments, and votes are closed.