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

What is "LoadAnimation requires an Animation object" and why won't my animation load?

I have no Idea why this isn't working. I am using an animation for a monster in my game. Also, this is a script and not a local script in case that has anything to do with it.

local Animation = script.Parent.AnimSaves.Run
local rig = script.Parent
rig:WaitForChild("Humanoid")
local humanoid = rig.Humanoid

print(Animation.ClassName)
print(humanoid)
local AnimTrack = humanoid:LoadAnimation(Animation)

AnimTrack:Play()

Here is my output:

KeyframeSequence - Server - Script:6

11:06:43.129 Humanoid - Server - Script:7

11:06:43.129 LoadAnimation requires an Animation object - Server - Script:8

11:06:43.129 Stack Begin - Studio

11:06:43.129 Script 'Workspace.Monster.Script', Line 8 - Studio - Script:8

11:06:43.130 Stack End - Studio

1 answer

wait nevermind i fixed it

local Animation = Instance.new("Animation")
Animation.AnimationId = 'rbxassetid://7100391419'
local rig = script.Parent
rig:WaitForChild("Humanoid")
local humanoid = rig.Humanoid

print(Animation.ClassName)
print(humanoid)
local AnimTrack = humanoid:LoadAnimation(Animation)

AnimTrack:Play()

2 comments

0

Please make this the correct answer so other people know this is fixed.

0

Please make this the correct answer so other people know this is fixed.

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