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

Humanoid is not a descendant of game?

http://i.imgur.com/uCncN1E.png

That's the error, and that shouldn't be possible in the local script as everything else works except animations. But it exists and I don't know how to get rid of it.

Many people have this issue but nobody knows how to fix it based on the amount of searching I've done.

Here's the code:

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local Humanoid = Character:WaitForChild("Humanoid")

local RunningTrack = Humanoid:LoadAnimation(RunHolder:WaitForChild 'RunAnim')
RunningTrack:Play()

Any solutions?

1 comment

0

adding while not Humanoid:IsDescendantOf(game)do Humanoid.AncestryChanged:wait()end before line 5 might fix this.

1 answer

Try this, if it doesn't work, lmk:

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local Humanoid = Character:WaitForChild("Humanoid")
local RunAnim = -- Define your Animation here
local RunningTrack = Humanoid:LoadAnimation(RunAnim)
RunningTrack:Play()

1 comment

0

Actually, the solution I got was to use :InvokeServer() to define the objects since Workspace was referenced locally.

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