I have an issue with my sprint function, it resets once I touch the ground after jumping.
I also tried to reproduce the problem with a single key ( Left shift ), and the same issue is still there.
What I want the sprinting function to do, is to also sprint while in the air and not reset when touching the ground.
Is this possible?
Tested it in 9.20.3 and had no problem with this. You could also try manually set max walk speed in CharacterMovement Component to 1000 and add bool variable (for ex. “IsSprinting”) when LShift pressed set to true, when released, false. Then add to Movement input branch where you check “IsSprinting” variable, and if it’s false just divide the Input Axis value by whatever you want (/2 means your max walk speed is 500).
So you MaxWalkSpeed will stay the same but input (AxisValue) will change.
Thank you so much for your help with this issue! I made a fresh FPS project and was able to recreate your solution. Now to implement it into my project
But then comes the question, how do I increase the walking speed?
Now my character walks super slow, I tried changing the MaxWalkSpeed to 2000 even 4000 but there was no change in speed.
Setup your bluprint like I did on image and run it. There is no way it isn’t working correctly. It should print 500 speed when you are not sprinting and 1000 when you are sprinting.
I tried it again, now more closely looking at the end result.
So first I do not jump, just walk and run to test the states. And it works perfectly, it shows walking speed 600 correctly and 1200 max speed correctly. Please see images below:
When I test it in a new clean project it seems to work fine. I will try to integrate it into my project somehow and see what I did wrong or what I have changed. Thank you so much for your help!
Are you sure you didn’t change any other variables in character movement except max walk speed ? Also have you changed anything else in blueprint ? Did you try to make new, clear character blueprint with the SAME sprinting settings ?
I made a new character blueprint and tested it in my game. Everything works fine now! I guess it was some settings in the old blueprint conflicting. Thank you again!