Custom character walking animation (Need Help)

I made a custom character and Im making a walk animation.
The code works fine but the animation only play one time.
If I want it to play again I have to stop then move.
I want it to play the animation again and again intil I stop.

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

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

humanoid.Running:Connect(function(Speed)
	if Speed > 0 then
		if not WalkAnimT.IsPlaying then
			WalkAnimT:Play()
		end
	else
		if WalkAnimT.IsPlaying then
			WalkAnimT:Stop()
		end
	end
end)

Is the Looped property of the animation set to true?

I dont think so. How can I see if its true?

By checking the properties of the animation you’re loading

image

I did it thank you

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local walkAnim = script:WaitForChild("Walk")
local WalkAnimT = humanoid.Animator:LoadAnimation(walkAnim)
WalkAnimT.Looped = true

humanoid.Running:Connect(function(Speed)
	if Speed > 0 then
		if not WalkAnimT.IsPlaying then
			WalkAnimT:Play()
		end
	else
		if WalkAnimT.IsPlaying then
			WalkAnimT:Stop()
		end
	end
end)

1 Like