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?
Please see screenshot attached of my blueprint.
Thank you for any suggestions
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.
Did you change your Max Walk speed in CharacterMovement component ?
Sorry for not specifying, yes I did.
Do you manage to increase speed this way?
of course. So when you set your Max Walk speed in CharacterMovement component to 2000 your speed ingame is not 2000 ?
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 will try it tomorrow and report back to you and post a screenshot here. Thank you again!
Hello again and good day,
I tried entering the event tick solution, and it gave me some interesting results with my current settings as you can see.
Please see images below.
And this is the result displayed below.
so it works 1200 / 2 = 600 whats the problem ? the bottom numbers are slowing down I guess. When you sprint you should have full 1200 speed…
Hello again, and sorry for all of this.
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:
But then I jump, and it goes by half. So the speed for running is now 600 and walking is now 300. Please see images below:
These are the blueprints:
I didn’t change anything else, I will try to make a new clear character blueprint with the same settings for testing.
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!