Error: LoadAnimation requires the Humanoid object (NameX.Humanoid) to be a descendant of the game object


This is the error. I only get it in games, not in studio.

wait()

local sword = script.Parent
local plr = game.Players.LocalPlayer
local isequipped = false
local idle = sword:WaitForChild("Idle")
local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local animation1 = humanoid:LoadAnimation(idle)
local animationtwo = sword:WaitForChild("HitTwo")
local playanimationtwo = humanoid:LoadAnimation(animationtwo)

This is inside a sword in the backpack/starterpack
the error is about loadanimation(animationtwo).
for some reason i dont get the error when loading the idle animation

you should load the animation into the the humanoids “Animator”

local track = humanoid.Animator:LoadAnimation(AnimationHere)
track:Play()
1 Like