I made a basic animator script to play a walk animation if a character is walking and an idle animation if they are standing still
local Animator = Instance.new("Animator", script.Parent.Humanoid)
local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://616158929"
local Idle = Animator:LoadAnimation(Anim)
Anim.AnimationId = "rbxassetid://616168032"
local Walk = Animator:LoadAnimation(Anim)
Anim:Destroy()
local Playing = Idle
script.Parent.Humanoid.Running:Connect(function(Speed)
local Anim = Speed > 0.0078125 and Walk or Idle
if Anim ~= Playing then
Playing:Stop()
Playing = Anim
print(Playing == Idle and "Idle" or "Walk")
Playing:Play()
end
end)
I very clearly call :Stop()
and then call :Play()
on a different track but the walking animation never stops even after my print statement prints Idle
meaning Idle
should be playing
Why does :Stop()
seem broken?