I've been trying to run an animation inside an AI and it just won't work, even after following the instructions of the wiki and besides that I can't anything that will help. Please help me out The only output is: "Argument error: must be an Animation object"

AnimController = script.Parent.AnimationController
Animation = script.Parent.Animation
AnimTrack = AnimController:LoadAnimation(Animation)
Debounce = false
 
function Anim()
    if not Debounce then
        Debounce = true
		wait(1)
        AnimTrack:Play()
		wait(1)
        Debounce = false
    end
end
 
script.Parent.Torso.Touched:connect(Anim)

4 comments

0

When loading the animation, it has to be loaded into the humanoid.

0

@Xoqex With the exception of non-player characters. http://wiki.roblox.com/index.php?title=AnimationController

0

What's the "Animation" object's class name?

0

Animation