How to get player controller reference in this case?

I currently have 2 players on the map, on my multiplayer game. And I need to spawn a HUD widget for each player, on their individual screens. Problem is, for whatever reason, Unreal swaps their respective widgets and I’m not sure how to fix that. I’m thinking if I can get the player controller reference for each player, then maybe I can fix this.

The latest I’ve tried is looping through the playerstate array on gamestate and getting the player id, then matching that against the character’s player id that is making the request, but it still comes back as null when it’s returned to the character blueprint. On top of that what I’ve tried is calling getcontroller and plugging it into the owningplayer socket on CreateWidget, and it partially resolves the problem, since it stops the widget swapping. And when I look into the debugger, one of the Clients(I think Client0) is able to pick up a reference, but the other one still can’t. Any ideas?

Are both player clients? Clients only know their own controller. If you want to assign player roles, you need to do it on the server. Dedicated server or listen server would have player controllers of all including server itself.

One of them is a client, the other is listen server. When you say “do it on the server”, do you mean I should use something like the HasAuthority node and do it from there? If so, then where should I place it? Should I use it on gamestate or on the character blueprint?

The order of class being constructed on a server would be GameState > PlayerController > PlayerCharacter. On your player character there is an Event Possessed where it only run on server.
image

I am simply checking if pawn’s controlled by server and load different HUD there. The RPC is calling on owning client.