Widget binds not finding correct player index

I’m currently working on a local co-op game supporting up to four players, I’m now working on the HUD for the players. My issue seems to be the binds not “finding” the correct player index, this is how I have it set up: A widget blueprint with two different health bars, each one has it’s percentage bind, one for the player index 0 and the other for player index 1.

I create the widget in the level blueprint and add it to the viewport

This is the outcome and everything works correctly when I play this specific level.

However, things get ugly when I try to load the level from a menu or any other map, I’m using the OpenLevel node to open the map from a main menu widget button onclicked.

134717-screenshot_5.png

The binds don’t work at all, any of them, it seems like the cast fails or some problem with the index is the only thing I could think of, I added a delay before creating the widget to make sure the character would already have been created before the widget, but I can’t seem to fix or find the issue at all.

Use the node “Get Owning Player”

I tried with “Get owning player” and “Get owning player pawn” but the result is the same. I don’t understand why since it only happens on map change

I couldn’t get it to work, I believe its something wrong with the player controller however I managed to pass the information to the widget directly through the player character and it worked fine.

However I still believe the correct way to do this is how vanlacke said and use the “Get Owning Player” node.