Walk Animation won't work

Alright so I made a custom character and it won’t play its custom walk animation I made. The local script is placed in startercharacterscripts and the animation is parented to the script. There are no errors in the output. What is wrong.


local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")


local walkAnim = script:WaitForChild("Walk")
local walkAnimTrack = humanoid.Animator:LoadAnimation(walkAnim)

humanoid.Running:Connect(function(speed)
	if speed > 0 then
		if not walkAnimTrack.IsPlaying then
			walkAnimTrack:Play()
		end
	else
		if walkAnimTrack.IsPlaying then
			walkAnimTrack:Stop()
		end
	end
end)
2 Likes

Is this an r6 or r15 animation? You might need to check if your custom character and your animations match to the body type.

2 Likes

Its an r6 animation, and the body type is r6

1 Like

What do you think else could be wrong with it?

2 Likes

Error happens because in this line it says that if your speed is more than 0 then animation must stop

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")



local walkAnim = script:WaitForChild("Walk")
local walkAnimTrack = humanoid.Animator:LoadAnimation(walkAnim)

humanoid.Running:Connect(function(speed)
    if speed > 0 then
        walkAnimTrack:Play()
    else
        walkAnimTrack:Stop()
        end
    end
end)

tell me if this works

3 Likes

Got the error:

Workspace.trueblockhead101.Animate:16: Expected ‘)’ (to close ‘(’ at line 9), got ‘end’

1 Like

I actually fixed the issue, I took out one end and there were no errors for the script. Though the walking animation does not play.


1 Like