UE5 jumping in and transitioning to falling from custom movement mode

I am using UE-5EA but the forum required that I put a version tag, and the 5-0EA tag did not count.

I am working on a custom movement mode in C++ for sprinting. When it is active I set the max walk speed from inside of OnMovementModeChanged and run the same code that is run by default on MOVE_Walking. Then inside of PhysCustom I just call PhysWalking.

It almost works. I can run faster when I enter the custom movement mode, but as soon as my character runs off of a ledge it does not transition to falling movement, and it just freezes in place. Also, when I try to call the built-in jump function, it does not work. AddForce and AddImpulse don’t work while my character is in the custom movement mode.

Does anyone know why this may be? I know about the existence of Saved Moves and Network Prediction, but this way seems to be more convenient during development, especially because I can just switch on a custom movement mode in my blueprints instead of hooking up multiple branches.

Thanks for considering!

1 Like

Your best bet is to run the code that doesn’t work with the walking movement mode, then run it in your code, breakpoint it, and step through to figure out what’s happening.

Movement code isn’t easy to debug, good luck.

1 Like

Thanks! I just managed to figure it out. What I needed to do was override the IsMovingOnGround and IsCrouching functions to also detect custom movement modes.

1 Like