I would like to open and close a widget while im in a trigger box on key press and so far when showing the widget i works fine. But the problem is that when i want to close the widget by pressing the same key, it wont work.
i tried the answer from this https://answers.unrealengine.com/questions/831563/press-e-to-open-widget-press-again-to-close.html but it is still not working.
The use of the trigger box is that, when im not within the trigger box and i pressed E, nothing will happen, but when im inside, it will show the widget. The problem here is that, when i press E it will show the widget, but when i press it again it will do nothing, like in here it will just print a string but it is not working. I tried to view the code while it is launched, and the node when i pressed E lights up, but when i press it again it doesnt light up.
And regarding the visibility of the widget, i actually tried that first, but its not quite what i was aiming for, so i had to resort to create and destroy on endoverlap
Where does a trigger box come into play here? It doesn’t seem like the trigger would have any effect. Also, if you are just simply hiding and revealing a widget, better to create it once and toggle its visibility instead of creating it every time you press E and then have to destroy it, or worse, you end up with 20 widgets on your screen that are invisible one for each key press. So they just accumulate as the game goes on. Also that “flip flop” node is useless the way you have it set up. Finally, the sequence node you have, I see it goes to a thing that “on end overlap” will remove the widget. That will never execute the way you think. if it is truly an end overlap event down there…this is a very weird set-up. Screen shot the rest of it just so I am sure, but it doesn’t look good my friend.
are you using any kind of set input mode or pausing the game? that could cause the issue. the only other thing i can think of at the moment would be a input not having priority or input being disabled (character leaving the overlap).
below are a few examples of working setups similar to yours. the first is a basic actor bp. the second was done in the player controller but shows how a pause menu and setting input modes could work.
Whoop looks like it was my mistake all along, thanks for your answers guys, i realized i was disabling the input after pressing E which explains why it wont respond to the second key press
Is it okay to ask for another problem here related to the widgets ? or should i make another post ?
New question if it isn’t related to the problem you asked here. Otherwise things will get confusing if someone else has a similar issue they would never be able to find the thread about it by searching for their problem since it would be under a different question title.