Hello, I just created widget where I want that to show when I press E keyboard button.
I did everything but nothing was working for me. So I am here for asking you.
several things to consider… but first is you shouldnt call visibility until after widget is created…
@Dev.Designx
- Create a widget somewhere. For example at begin play event.
- Put it to variable.
- Use this variable as a target of set visibility.
This should work for you instead of creating new widget every push and release)
So I made widget and i putted that into begin play event but how can I put that it to variable?
Right click the *ReturnValue *of CreateStronaWidget and PromoteToVariable. This will create a reference variable to that widget which will allow you to access it later; it will also prevent the widget from getting destroyed if you remove it from the viewport.
It still doesn’t work
I just answered the very last question. When you say it does not work, I believe you refer to the original issue where your Monitor blueprint does not respond to the keyboard key, right? As default the keypresses are handled by the PlayerController rather than a particular blueprint.
You can override this behaviour, of course. Access *ClassDefaults *at the very top, scroll down to Input section and set *AutoReceiveInput *to Player0. This should allow this blueprint intercept the Action and Axis mapping.
It is working now! Thank you so much @Everynone !!!
But when I press again E button it still shows me widget.
If i press right click and i write there get widget reference it haven’t show me anything there.
You created a reference to the widget, right? You said it worked. That reference will appear on the list with all other variables. Drag it to the graph → Get, right click convert:
It’s pretty much the same as this, but will less wires, more convenient:
It is working !!! thank you so much @Everynone you are really helpfully !!!
If I want to pause game should that connect pause game to the exact of visibility ?