Why isnt this animation script playing?

local userInputService = game:GetService(“UserInputService”)
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild(“Humanoid”)
local Track = Instance.new(“Animation”)
Track.AnimationId = “rbxassetid://501532492”
local Animation = player:LoadAnimation(Track)
character:Play()

14:59:42.023 - LoadAnimation is not a valid member of Player

:LoadAnimation(Track) needs to be run on a Humanoid. Try to do local Animation = humanoid:LoadAnimation(Track) instead. You’ll also need to change character:Play() to Animation:Play() for this to function properly.

1 Like