Animation Not Playing

Hey guys, It’s Army here.

So I’ve been trying out animations as I’m going to make an attack animation, but I decided to test one first. I make a simple animation, try to get it to play via a script, and It won’t work. Everything seems to work, but for some reason, It’s telling me that Test (Animation Name) Isn’t part of the script when It’s the child of the script. Does anyone know how to fix this?

Code:

local LocalPlayer = game.Players.LocalPlayer
local Character = game.Workspace:WaitForChild(LocalPlayer.Name)
local Hum = Character:WaitForChild("Humanoid")

local Animation = Hum:LoadAnimation(script.Test)

wait(3)

Animation:Play()

The animation location:

Loading tracks to the Humanoid has been Deprecated
You have to use the animator object INSIDE the humanoid now, try this instead…

local LocalPlayer = game.Players.LocalPlayer
local Character = game.Workspace:WaitForChild(LocalPlayer.Name)
local Hum = Character:WaitForChild("Humanoid")
local Animator = Hum:FindFirstChildOfClass("Animator")

if Animator then
 local Animation = Animator:LoadAnimation(script.Test)

 wait(3)
 Animation:Play()
end

However im not sure if they ever REMOVED the old loadanimation method, if this doesnt work could you tell me the animations Priority?

Still giving me an error, saying Test is not a valid member of the script. Don’t know why the priority matters but it’s core.

Ok, I tried making the script a child of the animation and classifying it as a parent of a script, and It worked. Do you know why it won’t classify as the child?

WaitForChild

wait for me please :sweat_smile:

That did work, but why didn’t using script. work?

and what do you mean by wait for you?

because the script can run faster than an instance can load

1 Like

Hm. Thanks, that helped a lot. :slight_smile:

I solved the same problem here in this topic, check it out!

Animations not working

1 Like