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"

Call press and hold button via blueprint

Hi all, why sae engine press "X" button without input event. I know how work with event and user input, but problem if I need simulate user input and execute "Press any button and HOLD" via blueprint. I try via event tick, but button press without hold alt text

Product Version: UE 4.21
Tags:
screenshot-1.png (187.0 kB)
more ▼

asked Jan 16 '19 at 08:58 AM in Blueprint Scripting

avatar image

Schepetkov
34 4 3 9

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

2 answers: sort voted first

You can simply open the Gate when you press the key, and close it upon release.

Or set a bool wariable to True/False, and do what you need while it is True.

more ▼

answered Jan 16 '19 at 10:21 AM

avatar image

Tuerer
1.7k 11 6 8

avatar image Schepetkov Jan 16 '19 at 11:54 AM

I know, but it not work, button press without hold.

avatar image Tuerer Jan 16 '19 at 11:59 AM

What is the action you want to execute after the ley is held down for some time? You can use Tick, Gate and a float variable — add Delta seconds to the float on each tick and check if it's more than, say, 3 seconds; and when the key is released — set float to 0;

Or upon presing the key start a Timeline with a curve that goes from 0 to 1 in 3 seconds, and check if the value is 1. The same curve may be used to drive some animation like a progress bar.

avatar image Schepetkov Jan 16 '19 at 12:10 PM

we have custom logic in our project and all work via event "Any key press", but this event wait when user relese button, as I sae befor via event tick event it not work if you look on image you will see gate node. I want sae engine (hold this button)? I want simulate "event any key press".

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

Hi, you can try one of those solutions:

The first one (F key) invoke your methods ONLY at button release.

The second one (E key) invoke your hold method if the time has passed, the normal method at release (if the hold didn't get invoked).

alt text

pressionmanager.png (444.5 kB)
more ▼

answered Jan 16 '19 at 07:27 PM

avatar image

Iohoilpotere
691 23 11 28

avatar image Schepetkov Jan 17 '19 at 09:14 AM

Hi Iohoilpotere, thank for support, but this solution will work if you press key or use input. I need sumulite hold without any keybord, in my functional tests I save all user input in array and send it to server, but when I execute press button event I need sae server hold button, I can not use epic event.

avatar image Schepetkov Jan 17 '19 at 09:20 AM

I work only with "code" without any input (keyboard or gamepad). In other words, I want call "any key" event via blueprint when game run. Sorry for my english.

alt text

screenshot-2.png (123.6 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