How do I get my character to keep his momentum when jumping?

For context I’m making a game with a heavy emphasis on parkour and aireal control, however when no keys are pressed I want the character to preserve momentum and keep moving in the direction he jumped in. However UE5’s base thirdpersonplayer does not preserve momentum resulting in a really flat jump. I want a lot of movement tech (bhopping, dashing etc) so if I’m gonna figure any of that out I need to figure this out. Please help (think of how in mario 64 when you hold the analog stick up and jump (then release the analog stick) mario will still keep going in that direction)

Also, how do I make it so pressing A and D cancels out instead of just always going to the right (or W and S always going backwards)? I want precise movement and the way it should work is cancelling out (think of counter strafing)

bump because I need an answer

are you using default character movement class / component?

for the keep moving if no input is made you can access "breaking deceleration fallin` as zero it will keep moving.

can show how to make in bp or preferably in c++ how to do it as extended custom movement.

So pretty much I can help with any kind of movemevent including kinematics and physics movement.

However would like to understand your question first, so have to ask some questions first about it.

    • Do you want counter strafing A and D at any time and movement status? Ex: You want it only on ground ? or Ground Air Swim etc.
  1. What type of cancel out you want? If A and D pressed together there is no movement? Lets say you are going right with D and you press A it stops.. if you stop pressing D it starts going left?
  2. What kind of cancelling you want? is it instant or you want easing stop? slowly stop? It really depends the game feel, older games use hard stops especially platform genre, newer games dont, competetive FPS differ in this cause it effects a lot of things that is not subject here.

Just to be helpfull if you don’t want something too specific and custom and you want just cancelling on movement vector

you can access input move and change accumulation method to cumulative which will naturally cancel out movement in Keyboard cases.

sorry for the late reply but I really appreciate you helping, I want to make a really fluid parkour based platformer like a mix of sonic unleashed and jet set radio so basically what you described, if you are walking left with a and tap d you stop moving and cancel out allowing you to be precise (same goes for cancelling w and s for forward and back)

And I want to try and make this work in both air and on ground.

Sorry if this is a bit much, I have a lot of ambition when it comes to this game because it’s a passion project but even though I’ve got a lot of the other mechanics working this has alluded me

Also yeah using default thirdpersoncharacter component. Braking decel is actually on 0 already. I have tweaked the breaking decel for walking but that is intended and even when I set that to 0 it does not preserve momentum

try these two while walking if you want to keep momentum fully. Ground Friction and Deceleration Walking.

you can add a bit breaking deceleration if you eventually want it to stop after a while.

For the cancel out as said on the post above you can change accumulation method to cumulative.

so this is basically how it acts on my machine atm with a blank project

123123

on top of this if you want to stop cancel inertia immidiately on character your can basically do a very high acceleration. However you can detect move vectors also do it manually too.

This high acceleration results in this

1231232131aaa

Tried it, your method for cancelling a and d out worked (You are a lifesaver). Either way I want to preserve momentum when I jump or am airborne, walking is already tweaked fine (for now at least) so I’d like to know how to make jumping keep momentum

Using no deceleration in air (jumping) will keep momentum. Since there is no negative acting total force on object momentum is conserved.


my issue is that I’ve already done that and it isn’t working, I don’t know why it’s like this. Is there like any coding I have to do to fix it?

I don’t think so, checking with gamepad and keyboard with your settings everything seems to be fine (keeping inertia as expected since there is nothing to stop it) until it touches ground.

Some other thing on your setup can be interfering with movement.