Ходьба игрока

1111

1111

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

-- Убираем стандартный Animate
local animate = character:FindFirstChild("Animate")
if animate then
	animate:Destroy()
end

-- Загружаем свою анимацию
local walkAnimation = script:WaitForChild("Animation")
local walkTrack = animator:LoadAnimation(walkAnimation)

walkTrack.Looped = true
walkTrack.Priority = Enum.AnimationPriority.Movement

-- Проигрываем только при ходьбе
humanoid.Running:Connect(function(speed)
	if speed > 0.1 then
		if not walkTrack.IsPlaying then
			walkTrack:Play()
		end
	else
		if walkTrack.IsPlaying then
			walkTrack:Stop()
		end
	end
end)