Custom Movement System. Where Do I Start?

Hello, world!

I want to make a 5v5 battle arena game where it has similar gameplay as Dota 2. I’m trying to make a movement system but I don’t know where to start since I have never done it before. I’ve read some other posts but they are not enough to help me. So, my goals are making a not very complicated custom movement system (No jumping, climbing, swimming) that works without humanoid. I hope y’all can help me figure this out. Thanks!

3 Likes

Why no Humanoid? No ControllerManagers either? Well, it can be very complicated, but usually a starting point is having a Velocity variable, and changing it based on Input, then moving the character based on their Velocity:

local MovementSpeed = 15
local Velocity = Vector3.zero

RunService.PreSimulation:Connect(function(DeltaTime)
    local additiveSpeed = MovementSpeed * DeltaTime
    
    if UserInputService:IsKeyDown(Enum.KeyCode.W) then
        Velocity += Vector3.new(0, 0, -additiveSpeed)
    end
    
    -- Other input checks etc etc
    
    ...
    
    Character.Position += Velocity * DeltaTime
    -- Lose 50% of your Velocity every second,
    -- so you don't infinitely gain speed
    Velocity -= Velocity * 0.5 * DeltaTime
end)

Obviously, this does not take collisions into account, but you can use a Blockcast to figure out when the Character is moving into a wall and snap them to that walls instead of phasing through it.

1 Like