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"

Fuel = Fuel - Key Down Time

Im trying to create a jetpack fuel calculation, look at the following: The "jump key hold time" is the time in seconds of the jump key down. I have the fuel = 3 and want to substract it from the keydown time. alt text The above screenshot is what doesnt work for now, The Event tick calls every frame, that means every frame it substracts the given value of the key down. So in the end the fuel value is for example "-190324" or something. How can I make the fuel get less with the key hold time ? for example if the fuel is 3 originally, and the key is down for 2 seconds, the fuel slides down to 1 .

Product Version: UE 4.10
fuelmath.png (109.9 kB)
more ▼

asked Feb 27 '16 at 04:59 PM in Blueprint Scripting

avatar image

1 1 2

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

1 answer: sort voted first

Instead of using key down time couldnt you use a timer? You can start(Set) the timer with jump key and then clear it with Jump released.

more ▼

answered Feb 27 '16 at 05:04 PM

avatar image

16.7k 671 167 674

avatar image Slastraf Feb 27 '16 at 05:30 PM

but that would be the same as the value of jumpkeyhold time, no need for that i think you misunderstood my question or i misunderstood your reply. Could you go in detail please ?

avatar image Jacky Feb 27 '16 at 05:47 PM

With timer you wont need to use event tick and check the key value condition every tick.

alt text

In this setup the fuel amount will drop .05 every .05 second. You can change those values as you please.

fuel.jpg (63.6 kB)
avatar image Slastraf Feb 27 '16 at 05:52 PM

that will do it. thanks for the replies. I will check that out now

(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