Why run animation isnt playing? [SOLVED]

--Services
local Player = game:GetService('Players').LocalPlayer
local RunService = game:GetService('RunService')
local InputService = game:GetService('UserInputService')

Player.CharacterAdded:Connect(function(Character)
	local Humanoid = Character:FindFirstChild('Humanoid')
	if not Humanoid then
		return
	end
	local HumanoidRootPart = Character:FindFirstChild('HumanoidRootPart')
	-- Walk Animation --
	local Walk_Animation = Instance.new('Animation')
	Walk_Animation.Name = 'Walk_Animation'
	Walk_Animation.AnimationId = 'http://www.roblox.com/asset/?id=16970392360'
	local Walk_Track = Humanoid:LoadAnimation(Walk_Animation)
	-- Idle Animation --
	local Idle_Animation = Instance.new('Animation')
	Idle_Animation.Name = 'Idle_Animation'
	Idle_Animation.AnimationId = 'http://www.roblox.com/asset/?id=16936362170'
	local Idle_Track = Humanoid:LoadAnimation(Idle_Animation)
	-- Run Animation --
	local Run_Animation = Instance.new('Animation')
	Run_Animation.Name = 'Run_Animation'
	Run_Animation.AnimationId = 'http://www.roblox.com/asset/?id=16972097078'
	local Run_Track = Humanoid:LoadAnimation(Run_Animation)
	
	local Can_Walk = true
	
	local function StopAnimation(except)
		for _, track in ipairs(Humanoid:GetPlayingAnimationTracks()) do
			if track ~= except and track.IsPlaying then
				track:Stop()
			end
		end
	end
	
		local function Idle()
		StopAnimation(Idle_Track)
		if not Idle_Track.IsPlaying then
			Idle_Track:Play()
		end
	end
	
	local function Walking(Speed)
		StopAnimation(Walk_Track)
		if not Walk_Track.IsPlaying and Can_Walk == true then
			Walk_Track:Play()
			Humanoid.WalkSpeed = 10
		end
	end
	
	local function Run(Speed)
		StopAnimation(Run_Track)
		if not Run_Track.IsPlaying then
			Run_Track:Play()
			Humanoid.WalkSpeed = 18
			print('Running')
		end
	end
	
	InputService.InputBegan:Connect(function(UserInput, gameProcessedEvent)
		gameProcessedEvent = true
		
		if UserInput.KeyCode == Enum.KeyCode.LeftShift then
			Can_Walk = false
			local Speed = Humanoid.MoveDirection.Magnitude
			if Speed > 0 then
				Run(Speed)
			end
		end
	end)
	
	InputService.InputEnded:Connect(function(UserInput, gameProcessedEvent)
		gameProcessedEvent = true

		if UserInput.KeyCode == Enum.KeyCode.LeftShift then
			Can_Walk = true
		end
	end)
	
	RunService.Heartbeat:Connect(function()
		local Speed = Humanoid.MoveDirection.Magnitude
		
		if Speed > 0 then
			Walking(Speed)
		end
		
		if Speed == 0 then
			Idle()
		end
	end)
end)

The run animation isnt playing and idk why, no errors.

1 Like

reupload the running animation? it could be blanked or errored. I’ve never seen this before.

1 Like

I’ve done that, but it doesnt work
must be how I handle the run function because if I put the run animation inside the walk_Anim it works

1 Like

oh great to hear it works! mark your post as solved so there isnt any confusion! goodluck on your scripts and cya!

1 Like

well the animation works but not the run function ig

1 Like

is there any parts in the animation where nothing is happening? if so, delete those. That might fix the problem.

1 Like

not sure what you mean by ‘nothing is happening’. But in the animation the character isnt standing like that for sure

1 Like