I’m creating a FPP game prototype and I have an Inventory/Stats/Map widget that can be displayed by pressing a button (currently TAB). The widget is launched from Player Character Blueprint. When I use it on single levels it all works fine.
But on maps that involve level streming buttons become irresponsive. Once I click any button mouse pointer only blinks for a moment and nothing happens.
I tried spawning the widget from a level manager actor (that I created to store level data), but to no avail…
The first shows the script in Player Character Blueprint. I tried to follow how Fallout games do it. You press tab to open the menu but pressing it again will close it. This way any open menu can be closed with tab.
This is the code I put in an actor that manages level data (Time of day, and bunch of other settings). Such actos is present in each level that is being streamed to the persistent level. The persistent level does not have such actor.
In one of my attempts I’ve put that code into Persistent Level Blueprint but with no results. It got even worse, because when I displayed the widget and pressed TAB again to close it, it didn’t work (which happens when widget was launched from player blueprint).
The two most logical places to control menus from are the persistent level or, even better, the game instance.
There’s not a lot I can say about it. If you use the GI, the timing of opening and closing levels doesn’t matter ( you can even use ‘open level’ ) because the GI is constant throughout the game.
I tied it but GI seems not to receive input. It fails for both action events and direct key bindings. Do I have to preare the GI to receive player input?
You can use “Interface” to do something.
1.GameInstance Interface: create new function A;
2.GameInstance: implement function A->create/remove your UMG;
3.Player Character Blueprint/Player Controller Blueprint: TAB event->call function A(use interface, don’t cast your GI)
I tested them both and I still get the same result. The Widget displays or dissapears when I press TAB but none of the buttons is responding.
Oddly, I have no problem with keyboard inputs. When I press TAB repeatedly the focus switches between buttons and I can use space or enter to “click” them. But not with mouse.
Thank you for the answer but unfortunately it still didn’t solve the actual problem. I don’t mind focusable buttons. What I need is these buttons respond to mouse.
The issue is level streaming. Regular levels have no problem with it.
I found the solution, finally. The buttons were blocked by another widget. I created loading screen widget and I gave it Z order of 10. Even if it was invisible it still occupied the space above my menu widget.
Once i set the Z Order of my menu widget to something above the problem was resolved.