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

Why can't I play an animation with my code?

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

local GunHumanoid = Gun:WaitForChild("Humanoid")

local Animation1 = Instance.new("Animation")
Animation1.Name = "IdleAnimation"
Animation1.AnimationId = "rbxassetid://6317956041"
local Track1 = GunHumanoid:LoadAnimation(Animation1)

1 answer

✓ Accepted answer

The error is saying to parent the gunhumanoid to the object that's being animated.

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