Hey, so I was making my Player Character and I want to have it, where if you jump you will keep your momentum, similar to games like super mario and half life. I’ve tried looking up solutions and trying it myself but I havent found anything.
I recall those games having friction when you hit the ground, when it didn’t, you reached a maximum velocity before you either slowed down by going the other direction or from some other actor in the way.
This sounds like the solution might be in the character itself. The characters provided by unreal have a “MovementComponent” that dictates things like Friction, max acceleration and so forth
for maintaining momentum as your moving I think you’d want to have some of these values adjusted to increase your maximum values:
then I assume you’ll want some logic to boost the characters motion in a particular direction when moving, here we have a built in set of functions from the ThirdPersonCharacter blueprint, we can launch the character in the direction it’s already headed, and use our existing velocity (which will have changed suddenly with Jump() adding to you z velocity ) to launch ourselves in that particular direction:
the Launch function can be replaced with some other equivalent logic which would add a “Boost” in the direction of travel when you jump, you’ll need to toy around with max values to achieve the desired outcome, but this (in testing) gives the character a slight boost when jumping, reducing the “Ground Friction” to 4 allows use to slip just a bit when we’re going too fast and doesn’t slow us down much when we’re jumping repeatedly, finally, increasing “Max Walk” speed will allow us to have a ground speed comparable to our jump speed so we don’t slow down drastically when we hit the ground running.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.