Hello, as per title, I have a question regarding Local Players and restricting UI so that each Local Player has access to certain widgets only utilizing CommonUI cardinal navigation support for gamepads.
So the problem is I have a single Widget Blueprint with a hierarchy of interactable buttons. When I add a local user, I want some of the buttons to be excluded from primary player and make them focusable for a newly added Local Player only.
Hierarchy of widgets. Red mark indicates 2 widget groups that are to be separated input-wise:
I initialize the player like this:
And then update ownership of the buttons that I want to be restricted for the new Local Player:
This apporach sadly doesn’t work for me, as after calling Slate.AllowPerUserHitTesting 1
, it is still only the primary user who can navigate all the widgets. Tha newly added Local Player has no widgets available to navigate through.
What i found out is after initializng widgets dynamically (calling CreateWidget
) I achieve the behaviour I’m aiming for. Meaning the navigation is properly restricted.
I came to a conclusion that something is to be done during widget creation and that it is impossible to mess with widgets inside a single hierarchy the way i would like to. The thing is I didn’t find anything in the code which would answer my question if restricting navigation truly requires separate widget hierarchies or it is me who misses a step.