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"

Action on Button Held Down?

Hi, I'm looking for a way to have a player action continuing active while a button is held down in blueprint. Specifically, I'm using the Launch Character node. So I want Launch Character to be firing and increasing the character velocity as long as the assigned button is held down, and then stop as soon at it is let go. Any advice on how to do this?

Product Version: Not Selected
Tags:
more ▼

asked Sep 09 '14 at 08:43 PM in Blueprint Scripting

avatar image

Chroma Chris
86 20 20 28

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

3 answers: sort voted first
  1. Create a boolean variable, name it properly like "Is X Button Down", where X is your button name.

  2. Drag the key event, for examle F, to your blueprint

  3. Link Pressed to a "Set X Button Down" node and check the value on it.

  4. Link Released to another "Set X Button Down" node and leave the value unchecked

  5. Create a Event Tick node

  6. Connect it to a branch node, the Condition is a "Get X Button Down" node

  7. The True output leads to your Launch Character event stuff

  8. Your done :)

Remember to use Delta Seconds to compensate for CPU speeds

more ▼

answered Sep 09 '14 at 08:54 PM

avatar image

birdfreeyahoo
885 47 46 80

avatar image Chroma Chris Sep 10 '14 at 07:33 PM

This works like a charm- thank you very much! But can you explain what you mean by using Delta Seconds? I see the pin for it on the tick node but am not sure what to actually do with it. Appreciate it!

avatar image ScottSpadea May 21 '15 at 09:20 AM

deltaSeconds is how many seconds has passed between frames. usually you multiply it by a velocity, to make that velocity feel the same at different frame rates.

avatar image birdfreeyahoo May 21 '15 at 01:23 PM

Exactly! When you multiply a per-frame value-change with deltaSeconds, you get a per-second behaviour. That means if you add 1.0 to your velocity each frame and multiply with deltaSeconds, you add 1.0 per second.

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

As an alternative if you don't want a bunch of things tied to Event Tick:

alt text

I've got a five second long timeline that will perform the held action only on the execution of Finished, which only executes if the button stays pressed.

holdinput.png (131.6 kB)
more ▼

answered Nov 09 '17 at 01:48 AM

avatar image

Dieinthedark93
27 3 8 11

avatar image DiSLreport Nov 10 '17 at 05:19 PM

how did you made it without the event tick? (the bandage node) i am new to BP but and its look great

avatar image Dieinthedark93 Nov 10 '17 at 07:34 PM

Rather than just answering, let me help you understand. Why do you think you need an event tick?

avatar image DiSLreport Nov 10 '17 at 09:21 PM

i dont need event tick. i try to build a alter that the player need to press E to make a progress (like dead by daylight generator).

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

I would suggest using Physics Forces Instead of Launch in your case (Launch is usually a thing you fire once and not consistently) that you solve with a bool and Branch and hook it into Tick. Alternativly you can Change your Movement Component to Flying Mode and use the Add Movement Input to Controll the Direction.

You can hook it up to a Input Axis Event thats Bound to the same Key as your Action Event. Thats more or less it =)

Example https://i.imgur.com/zlOpLAQ.png

But just in case you really want to use Launch in Intervalls use Timers (the above example with the Timeline is a missuse of a Timeline, sorry Dieinthedark93, no offense) Example: https://i.imgur.com/PvvIiCi.png

Good Luck and have Fun

more ▼

answered Nov 10 '17 at 08:46 PM

avatar image

Nachtmahr
7k 143 28 172

(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