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)
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)