I have a widget in the viewport and I want to use the D-pad to navigate around while use the left and right thumbstick to play the game. How can I achieve that?
At the moment the left thumbstick also controls the UI so when I move around the selection in the widget also changes.
I found this online but it did’t solve the problem
Please let me know if you figure this out! I’m desperately trying to figure this out.
Was anyone able to figure this out?
here’s one way:
input is handled on the player controller
make an enumerator called something like “input state”
when the UI is active, change the InputState to UI_State and when the character is meant to walk, change it to "Movement_State
On the player controller, from the input events, switch on the enumerator. If its “Movement state” send the input event to the character blueprint to handle.
If it’s UI_State, send input event to the UMG to handle.
You can think of it like a switchboard.
Here is example from my project:
In the switchboard macro:
you can also wrap states into uobjects. That is a little more organized and you can leverage inheritance that way, but it is more steps to setup initially. More info on that here: State Management, State Machines, and the State Design Pattern in Unreal Engine 4 Blueprint - YouTube
there are other methods that involve managing an input priority which is probably the official way epic might handle things, but it’s more confusing to me because it’s a bit hidden and not explicit as you making the rules yourself.