5.5 Bug Screen Space Widget Components Not Visible For Client Pawns - FIXED

Hello fellow devs,

I recently updated my project to UE 5.5 and ran into the issue described in this post

The solution suggested there certainly will work, but if you’re compiling from source I believe I’ve found an easier solution. Make the following change to WidgetComponent.cpp:

Hope this helps someone else!

1 Like

Explanation: client controlled pawns have controllers on a listen server, but they don’t have a ULocalPlayer, so this method will always return null for client pawns, causing them to not be displayed. Not sure what the original intention here was…maybe just a bug?

Thanks, it helped me!

I’m not compiling the engine from source, but I made this workaround method instead:

void WorkaroundOwnerPlayer(UWidgetComponent* WidgetComponent, const UWorld* World)
{
	if (WidgetComponent && World)
	{
		if (WidgetComponent->GetOwnerPlayer() == nullptr)
		{
			if (const UGameInstance* GameInstance = World->GetGameInstance())
			{
				WidgetComponent->SetOwnerPlayer(GameInstance->GetFirstGamePlayer());
			}
		}
	}
}

I call this method in the code that runs on the (listen) server right before I do SetVisibility(true) on my WidgetComponent.

I did it in C++, I don’t think you can do the same in Blueprint unfortunately. Although both GetOwnerPlayer and SetOwnerPlayer are BlueprintCallable, as far as I know there is no way to do something like GetFirstGamePlayer in Blueprint :frowning:

I’m also curious if this is a bug or not … I’m on 5.5.4 at the moment.