Animation completly breaking any I dont understand why

For some reason my animation looks completly cursed can anybody tell me why?
Animation script inside the player:

--This is a localscript inside of StarterCharacterScripts
wait(1)
local run = false
if script.Parent ~= game.Players.LocalPlayer.Character then
	run = true
end
print(script.Parent)

local Humanoid = script.Parent:FindFirstChildWhichIsA("Humanoid")
local plr = game.Players.LocalPlayer
local AnimateTrack = {
	Idle = Humanoid:LoadAnimation(script.Idle),
	Walk = Humanoid:LoadAnimation(script.Walk)
}
local IsPlayingAnimate = {
	Idle = false,
	Walk = false
}

local RS = game:GetService("RunService")
local CurrentlyPlayingTracks
RS.RenderStepped:Connect(function()
	if Humanoid.MoveDirection == Vector3.new(0,0,0) then
		if script.Parent.Crouch.Value == true and IsPlayingAnimate.Idle == false and run == false then
			IsPlayingAnimate.Idle = true
			IsPlayingAnimate.Walk = false
			AnimateTrack.Idle:Play()
			AnimateTrack.Walk:Stop()
		end
	else
		if script.Parent.Crouch.Value == true and IsPlayingAnimate.Walk == false and run == false then
			IsPlayingAnimate.Idle = false
			IsPlayingAnimate.Walk = true
			AnimateTrack.Walk:Play()
			AnimateTrack.Idle:Stop()
		end
	end
end)

script.Parent.Crouch:GetPropertyChangedSignal("Value"):Connect(function()
	if script.Parent.Crouch.Value == false then
		AnimateTrack.Idle:Stop()
		AnimateTrack.Walk:Stop()
		IsPlayingAnimate.Idle = false
		IsPlayingAnimate.Walk = false
	end
end)
2 Likes