Simple momentum based slope climbing script

a quick and easy implementation of momentum based slope climbing

How it works
the humanoid’s MaxSlopeAngle is scaled alongside WalkSpeed per tick when moving to accomplish the effect of being able to walk up steeper slopes based on your speed

Source code

local accelerateRate = 30
local decelerateRate = 500

local max = 50
local min = 5

local plr = game.Players.LocalPlayer
local chr = plr.Character or plr.CharacterAdded:Wait()

local rootpart = chr:WaitForChild("HumanoidRootPart")
local humanoid = chr:WaitForChild("Humanoid")

humanoid.MaxSlopeAngle = min
humanoid.WalkSpeed = min

local lastPosition = rootpart.Position
	if humanoid.MoveDirection ~= then
		humanoid.WalkSpeed += dt * accelerateRate
		humanoid.MaxSlopeAngle += dt * accelerateRate
		humanoid.WalkSpeed -= dt * decelerateRate
		humanoid.MaxSlopeAngle -= dt * decelerateRate

	lastPosition = rootpart.Position
	humanoid.WalkSpeed = math.clamp(humanoid.WalkSpeed, min, max)

bit of a basic post, but hopefulyl it helps someone


Cool this is what I’m using because I’m making a game with lots of mountains

1 Like