Velocity based Movement System

Hi there

I want to create a custom movement system for wich i choose to make a velocity based one.

My problem is that im fairly new to scripting so i have almost no clue how to make one.
I’ve looked trough the devforum but i couldn’t find anything suitable.

I want to make this movement system as close to that from parkour reborn as possible but just the moving not like wallclimb or smth.

Just like this:
robloxapp-20250203-2004516.wmv (1.1 MB)

What i mean by that is to replace the default walkspeed movement system in roblox with a velocity based one that also keeps your velocity if you are jumping/falling and releasing wasd.

I hope you understand what i mean im sorry if its confusing but it would be great if you can help me.

Feel free to ask questions as to what i mean.

6 Likes

Hello There!

Im not entirely sure how to do it, but using ContextActionService you can override the basic inputs for walking (and I think also jumping!)

With that you can use something in roblox physics (like a VectorForce) to make the velocity go up when you press W and go down when you let go of it. Just use math functions to determine the exact movement of it.

Hope this helps :wink:

3 Likes

Im suprised that someone replied this fast so thanks.
Im gonna try that later

3 Likes

You can put a local script in startplayerscripts and paste this

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local rootPart = character:WaitForChild("HumanoidRootPart")

local userInputService = game:GetService("UserInputService")
local runService = game:GetService("RunService")

local speed = 50
local velocity = Vector3.new(0, 0, 0)

local function updateVelocity()
    local moveDirection = Vector3.new(0, 0, 0)

    if userInputService:IsKeyDown(Enum.KeyCode.W) then
        moveDirection = moveDirection + Vector3.new(0, 0, -1)
    end
    if userInputService:IsKeyDown(Enum.KeyCode.S) then
        moveDirection = moveDirection + Vector3.new(0, 0, 1)
    end
    if userInputService:IsKeyDown(Enum.KeyCode.A) then
        moveDirection = moveDirection + Vector3.new(-1, 0, 0)
    end
    if userInputService:IsKeyDown(Enum.KeyCode.D) then
        moveDirection = moveDirection + Vector3.new(1, 0, 0)
    end

    moveDirection = moveDirection.Unit * speed
    velocity = Vector3.new(moveDirection.X, velocity.Y, moveDirection.Z)
end

runService.RenderStepped:Connect(function()
    updateVelocity()
    rootPart.Velocity = velocity
end)

humanoid.Jumping:Connect(function()
    velocity = Vector3.new(velocity.X, 50, velocity.Z)
end)
1 Like

if i do that this happens wich is not what i want as its too buggy
robloxapp-20250203-2031468.wmv (887.8 KB)

1 Like

I got a pretty decent now. So for now i dont have any more questions thanks.

3 Likes

Instead of setting the velocity you could try using :ApplyImpulse().

1 Like