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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Sprinting problem...

Hello there, I was wondering if anyone could help me with this. I made a sprint and stamina system, however, I found an issue where the stamina bar would go down when holding sprint, or left shift, when standing still. I thought I could easily solve this issue by adding "Get Velocity" -> "Vector Length" -> ">=350" then connect it to a branch, and if true it would allow the player to sprint, while also checking if they're crouching. When I tested it, it seemed to work at first, the bar would not go down when I held sprint and was stationary, and I would sprint when I moved then held sprint. But, there was one "problem" if you will, that kept bugging me. If I were to hold sprint, or left shift, before moving, my character would not sprint. I tried "Move Forward/Backward Axis Values" -> "<=0" and connected it to a branch, and connect false to the next, but it would do the same thing.

So, I simply ask for two things:

  • Have the stamina bar not go down when attempting to sprint while stationary

  • Have the ability to hold shift before moving and still sprint

Here is the part of the blueprint at which the "problem" seems to occur:

alt text

Thank you, in advance.

Product Version: UE 4.16
Tags:
help wanted.png (592.5 kB)
more ▼

asked Aug 11 '17 at 11:31 AM in Blueprint Scripting

avatar image

Scooooooooot
1

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

1 answer: sort voted first

In order to make the sprinting responsive you need to make it axis dependent, which means that only when MoveForward is greater than 0 you will execute this sprint code when shift is pressed. By doing that you will make sure that your code will only be executed when you have forward input.

more ▼

answered Aug 11 '17 at 01:19 PM

avatar image

vorixo
326 2 6 13

(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