Woah, a lot of redundancy here my friend ;).
Just what exactly do you hope to achieve? You set up the Input to first show for UI then for Game inputevents. You do that twice in your LevelBP as well as in your Widget Construct. What you do next is Set up the same thing every Tick which is already set twice. So have a lot of nodes which do something already accomplished and end up not making any kind of changes.
Why do you think your LevelBlueprint shall create your UI Widget? Even more, you do not have any reference to that widget to update its content, if it shouldnt then you wont need some, but just in your second picture you reference self to the input. I would recommend to create a variable of this widget after its creation, here: in your LevelBP.
The Construct should just initialize the widgets content or bind some events but i think that a widget would not change the behaviour of input. Read a bit about Model-View-Controller(MVC)-Architecture.
oh… i end up writing too much again.
However, i would recommend the following:
- Create your ProtoHUDWidget(i call my Widgets “Widget” at the end to make it clear that this is not a HUDClass) within the PlayercontrollerClass and add a variable with the returnvalue.
- Add it to Viewport
- Now it depends whether your widget shall be interactive or not, i assume a PlayerHUD (showing stuff, like HealthBars, Compass a.s.o) wont. But because you wanna use “Set Input…” it seems you want to have an interaction (makes sense f.e. in RTS-Games), so where do you put this? For now you can put it right after Add to Viewport inside the PlayerController. This option is now valid right after begin play. Give your widget reference and a “self” for controller ref to it.
Try those 3 steps and tell me if its the stuff you want for now?
best regards