x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Jumping resets sprinting problem

Hey guys!

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

alt text

Product Version: UE 4.19
Tags:
more ▼

asked Nov 13 '18 at 10:37 AM in Blueprint Scripting

avatar image

NorseDesigns
3 1 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

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.

alt text

untitled.png (242.3 kB)
more ▼

answered Nov 13 '18 at 12:20 PM

avatar image

jozi341
102 6 9 13

avatar image NorseDesigns Nov 13 '18 at 01:59 PM

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

avatar image NorseDesigns Nov 13 '18 at 02:20 PM

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.

avatar image jozi341 Nov 13 '18 at 02:45 PM

Did you change your Max Walk speed in CharacterMovement component ? alt text

movementcomp.png (330.7 kB)
avatar image NorseDesigns Nov 13 '18 at 03:13 PM

Sorry for not specifying, yes I did. Do you manage to increase speed this way?

avatar image jozi341 Nov 13 '18 at 03:27 PM

of course. So when you set your Max Walk speed in CharacterMovement component to 2000 your speed ingame is not 2000 ?

avatar image NorseDesigns Nov 13 '18 at 03:32 PM

Yes, that is correct

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

alt text

movementcomp.png (508.6 kB)
more ▼

answered Nov 13 '18 at 03:49 PM

avatar image

jozi341
102 6 9 13

avatar image NorseDesigns Nov 13 '18 at 04:08 PM

I will try it tomorrow and report back to you and post a screenshot here. Thank you again!

avatar image NorseDesigns Nov 14 '18 at 08:12 AM

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.

alt text

avatar image NorseDesigns Nov 14 '18 at 08:14 AM

And this is the result displayed below.

alt text

run-speed-cap.jpg (37.6 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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...

more ▼

answered Nov 14 '18 at 03:40 PM

avatar image

jozi341
102 6 9 13

avatar image NorseDesigns Nov 15 '18 at 07:44 AM

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:

Walking Speed:

alt text

Running Speed:

alt text

walking-speed.jpg (29.3 kB)
running-speed.jpg (39.8 kB)
avatar image NorseDesigns Nov 15 '18 at 07:46 AM

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:

Walking Speed:

alt text

Running Speed:

alt text

avatar image NorseDesigns Nov 15 '18 at 07:53 AM

These are the blueprints:

Movement:

alt text

Sprinting function:

alt text

avatar image jozi341 Nov 15 '18 at 09:57 AM

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 ?

avatar image NorseDesigns Nov 15 '18 at 10:16 AM

I didn't change anything else, I will try to make a new clear character blueprint with the same settings for testing.

avatar image NorseDesigns Nov 15 '18 at 10:30 AM

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!

avatar image NorseDesigns Nov 15 '18 at 10:37 AM

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!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question