I’m trying to get an NPC that will change animations at different walk speeds (Like idle (0), walk (6) and run (15). However, the animation doesn’t play when play-testing and in the output it says “AnimationTrack is not a valid member of Animation”. What?
Code:
local Animation = game.Workspace.MIKKLE2.Humanoid.Animator
local Mikkle = Animation.Parent.Parent
local Humanoid = script.Parent.Humanoid
local RunAnim = Humanoid.Animator.RunAnim
local IdleAnim = Humanoid.Animator.IdleAnim
Mikkle.Humanoid.Running:Connect(function(speed)
if Mikkle.Humanoid.WalkSpeed > 0 then
Mikkle.Humanoid:LoadAnimation(RunAnim)
RunAnim.AnimationTrack:Play()
end
end)
local Animation = game.Workspace.MIKKLE2.Humanoid.Animator
local Mikkle = Animation.Parent.Parent
local Humanoid = script.Parent.Humanoid
local RunAnim = Humanoid.Animator.RunAnim
local IdleAnim = Humanoid.Animator.IdleAnim
Mikkle.Humanoid.Running:Connect(function(speed)
if Mikkle.Humanoid.WalkSpeed > 0 then
local a = Mikkle.Humanoid:LoadAnimation(RunAnim)
a:Play()
end
end)