For context, I’m making a custom rig with custom animations, the walk animation didn’t work so I checked the output, It said something about an infinite yield being possible on Player.Animation:WaitForChild(“walk”). Could anyone tell me what I’m doing wrong?
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local WalkAnim = script:WaitForChild("walk")
local WalkAnimTrack = Humanoid.Animator:LoadAnimation(WalkAnim)
local IdleAnim = script:WaitForChild("idle")
local IdleAnimTrack = Humanoid.Animator:LoadAnimation(IdleAnim)
Humanoid.Running:Connect(function(speed)
if speed > 0 then
if not WalkAnimTrack.IsPlaying and IdleAnimTrack.IsPlaying then
IdleAnimTrack:Stop()
WalkAnimTrack:Play()
end
else
if WalkAnimTrack.IsPlaying and not IdleAnimTrack.IsPlaying then
IdleAnimTrack:Play()
WalkAnimTrack:Stop()
end
end
end)
IdleAnimTrack:Play()
Here is a screenshot of the error message:
The message appears whenever you walk.
