Movement animation(s) not playing

Heyo! Currently, I’m making Sonic.EXE in Roblox for one of my projects. I want to make custom animations for the player’s idle, jump, run, and freefall. However, only my idle animation seems to play.
(I have not animated the jump and freefall yet, only the run and idle.)

Code:

--//Play movement animations
function ring_animation()
	local idle_animation = humanoid:WaitForChild("Animator"):LoadAnimation(script:WaitForChild("idle_anim"))
	local run_animation = humanoid:WaitForChild("Animator"):LoadAnimation(script:WaitForChild("run_animation"))
	
	humanoid.Running:Connect(function(delta)
		if delta > 0 then
			run_animation:Play(0, 20)
		else
			idle_animation:Play()
		end
	end)
end

Video:

Any help will be appreciated :cowboy_hat_face:

Try adding idle_animation:Stop() when run animation plays, and vice-versa

I figured out the problem, for some reason it wasn’t detecting if the character was running. I fixed this by changing it to Humanoid.MoveDirection.Magnitude.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.