Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago

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()
0
Please make this the correct answer so other people know this is fixed. CDXKIE 130 — 3y
0
Please make this the correct answer so other people know this is fixed. CDXKIE 130 — 3y
Ad

Answer this question