Accelerating an humanoid

So im making a game about speedruning and parkour, and I was thinking in a bunch of ideas and interesting mechanics for the game, and I though adding like an acceleration system, so the more the player moves, the faster it goes.

I tried to use Humanoid.Walkspeed in a loop while the player was moving but it was a little bit bugged and I didnt get the “acceleration” feeling. Also tried some BodyForces but they didnt made much effect (even though I made the character Massless). Im sure that the bodyforces would work but I dont know how to make them work.

If you ask me for the old code of the WalkSpeed, I dont have because I deleted it without saving :sweat_smile:, but I could make a similar copy if you need extra info.

1 Like

Maybe you could try this:

local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character.Humanoid

local VectorZero = Vector3.new(0, 0, 0)

local function Moved()
if Humanoid.MoveDirection ~= VectorZero then
Humanoid.WalkSpeed = Humanoid.WalkSpeed + (your walkspeed plus goes here)
else
print(“Stopped Moving”)
end
end

Humanoid:GetPropertyChangedSignal(“MoveDirection”):Connect(Moved)

4 Likes

Tested it and it woks quite fine, just have to make some tweaks to the code.

1 Like

Oh, nice. I hope your game become succesfully.

1 Like