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"

Stop using stamina when not moving

I have a system setup where when you hold shift down it activated a faster speed and simultaneously takes away stamina. This works while standing completely still however, and that is undesireable. I followed a tutorial "https://www.youtube.com/watch?v=T_xiaMMzBHQ∈dex=14&list=PLSlkDq2rO1t7vAQxmhRfEdDTjygDf1D7H" and didn't use some of the variables such as "Is Sprinting". I'm wondering if there is a way to only take away stamina if the character is actually moving. Please help, see code below. alt text

Product Version: UE 4.19
Tags:
1.jpg (102.3 kB)
2.jpg (381.6 kB)
more ▼

asked Dec 13 '18 at 01:11 AM in Blueprint Scripting

avatar image

Giancarlo_Pad
7 1 2 5

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

add a check where you're decreasing stamina, there're a few ways to check if the player is moving. Check for the axis input values of the movement, like this:

alt text

so true means player is moving the pawn, false means it's not.

captura.png (59.2 kB)
more ▼

answered Dec 13 '18 at 03:56 AM

avatar image

Evigmae
1.4k 6 3 7

avatar image Giancarlo_Pad Dec 17 '18 at 08:39 PM

Thank you, this worked perfectly. For people who may have this issue in the future, I'll add a snip of my edited code. alt text The Get Vertical and Get Horizontal function nodes are my W, S, A, and D axis mappings, the name might be different than yours.

3.jpg (88.3 kB)
(comments are locked)
10|2000 characters needed characters left
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