I presume that you making typical split screen and not doing anything fancy.
It sounds like you would just need to adjust the anchors in the blueprint. Otherwise, you could create a another UMG widget with your current UMG hud as the parent. Then you would switch between the two based on if that second, third, or fourth player is connected. That of course only works for the hud.
If you are talking about how do you get two different camera feeds into one viewport, that’s a whole other can of worms.
I’m trying to implement split screen in my game. I have a UMG hud and menu system that I’m trying to set to respective player screens. I set the widget owner to the correct player controller, but it still just adds to the whole view port like single player. I’d like to have widget adjust when split. Is this possible?
Yeah I’m talking about split screen in one monitor. As of now you can use create player node and it adds a split view for 2 players on one monitor. So basically trying to set widget for each player screen in one monitor. If this can’t be done with UMG widget, they need to make something for this. It would be so much easier if you could set widgets like that.
I am bumping this because there should definitely be a way to limit a UMG widget to a certain player’s viewport.
HUDs already works like this. For instance, when there are two players, each player’s HUD is restricted to his viewport. With UMG widgets, for whatever reason, this is not the case. It should be definitely that way, however.
I practically wasted a lot of time now realizing my HUD using a UMG widget, expecting it to work properly in split screen multiplayer. It’s virtually impossible to have one per player this way.
ATM, from what I can tell, you need to do it yourself.
When you create a HUD attached to a player, my assumption would be that the HUD elements would be bound to that player’s viewport, but it seems that this isn’t the case.
However, there’s a way to work around it (hoping that in the future it is handled better by UE). There’s a function that you can call on the widget to set Anchors.
The problem here is that you need to know exactly in which place each player is, which will require some code from our side.
ATM I have the following:
As you can see, this will setup a 2 player split screen. The delay is because I have some code that “orders” the players, i.e. gives them an index 0, 1, etc.
Then I basically calculate top half for player index 0, and bottom half for player index 1. Main variable is the widget.
If you need to support 3 players it will get a bit messier, but as long as you know which player you’re getting and the position it will end up on screen, it should be fine.
You don’t need to change anchors, instead you can use “add to player screen”. Remember to do that before the creation of the player so you can pass the player controller during the creation of the UMG instance.
Thanks to Daekesh for the hint
The other answers are hack , This is the real solution.