Widget Component not visible on 2nd player Split-screen.

I have a Split-Screen game setup and objects that have Widget Components on them set to Screen Space and only the 1st Player can see them and the 2nd Player doesn’t. How can I get the 2nd player to also see the widgets, too?

You need to spawn widget to both players and add it to viewports of both of player controllers.

You don’t mean HUD widgets, but widget components attached to Actors, floating around above their head or something, like a health bar or name tag, right?

I’m not sure, there’s a few ways this could happen. Is the Only Owner See checkbox ticked on those components? That could do it.

I am experiencing the same if anyone knows of a solution.

In my example I am making a shooter for local splitscreen play and each Player Pawn/Character has a Widget Component for a Player Tag Widget with the player name and health. Under the widget setting the User Interface → Space parm is set to Screen. When I change it to World everything works, except world looks pretty bad is its in the world and not on the players screen.

I think its because its not getting added to Controller 2 properly but I cannot figure out how to fix. I’m guessing this probably something that cannot be achieved in blueprints.

My current work around is to add logic to my hud itself that will draw and move it around the player screen , Its more convenient to manage being a component of the player though if anyone has a solution for this.

What version of Unreal are you using? I noticed some things don’t render properly in other splitscreens unless it is visible to player 1’s splitscreen, on one version of Unreal.

My favorite way to handle player nameplates and healthbars etc is to create a material for the widget component that orients it visually (though its actual rotation may be different) to the viewport camera of whoever is looking at it, and use that material on the widget component, but put that widget in World space not screen space.

The effect of this is that the widget will disappear behind obstacles rather than showing through them, and will get closer and further away along with the actor it’s attached to, but will always appear face-forward, no matter who is looking at it. The only situation where this is a bad thing is when you need the widget to be interactable or collidable, since its real geometry will be facing a different way than the rendered visual of it.

I’m using 4.25. My solution was going to try and do a search of PAWN that are on Screen, but your solution is likely less expensive.

I’ll look into a material that orients. Do you by any chance have a link to an example. If not, no worries of course because that gives me something to look for, thanks!

Not sure if this is the way I did it, but it appears to work:

Thanks for this advice. I struggled with this same issue, and attempted to implement the auto-facing material you suggested. I’m getting a strange behavior with it though. The material is working great in the blueprint editor for my object, but in-game the orientation of the widget is not the same, it is messed up. I’ve quite puzzled. Have you ever had this issue with this implememtation?
link text

I ended up finding out how to make the material in a much simpler fashion then what was described in the video. This worked like a charm, thanks

link text

To make matters stranger it seems that when I’m far away from the object it works…
link text

This is not exactly a solution to getting a widget to appear above each player in splitscreen, but I was having the same problem and decided to try and solve it by making a billboard font material that will always face the camera and exist in the world and not require attaching to each player’s viewport.

Add a TextRenderComponent to your Pawn and give it a material something like this:

https://i.imgur.com/hNhtzNP.png

This material takes into account the orientation of the actor it’s attached to and doesn’t rotate weirdly (from what I can tell so far). You can use the same node setup for the World Position Offset with a texture or whatever instead of a font to make anything billboard in this way.

An added bonus of this method is that the “owner no see” flag works, and the text is occluded by objects by default.

To do it with a widget, I think you need to make sure a copy of the WidgetComponent is added for each extra splitscreen player somehow. I haven’t tested this myself, because it seems like too much hassle just to make a name tag that is visible to each local player, but if I needed a more complex widget that showed health etc. it might be something I’d want to try. If you need to show screen space health widgets on enemies, then I think doing it with billboards and billboard materials is going to be an easier solution than widgets if all local players need to see it.

First, You should Check On “Component Replicates” to Widget Component

Second, than you need to make nodes " Run on server to Multicast "

Before, I just have been noticed for long time that Component where attached to Character dosen’t need to rpc or something (Check Replicates)…
But it’s wrong, There are many complicate things :slight_smile:

this fixed the issue for my case :

ActorWidgetHolder->SetOwner(this->GetOwner());

		if(UGameplayStatics::GetNumLocalPlayerControllers(GetWorld()) > 1)
		{
			if(AAbomPlayerController* APC =  Cast<AAbomCharacter>(this->GetOwner())->GetAbomPlayerController())
			{
				const int32 PlayerIndex = APC->GetLocalPlayer()->GetControllerId();
				const APlayerController* LocalPlayerController = UGameplayStatics::GetPlayerController(GetWorld(), PlayerIndex);
				ActorWidgetHolder->WidgetComponent->SetOwnerPlayer(LocalPlayerController->GetLocalPlayer());
			}
		}
1 Like

It works. Great, thanks!

Didn’t expect a local player owner at the WidgetComponent itself.

2 Likes

Could you try to share your blueprint on this? I am not sure how to access this. Thank you !