I created a game which has to work on a dedicated server. My main character is replicated, and he has an energy bar linked to the viewport by this code:
if (HealthBarClass)
{
if (!HealthBar)
{
HealthBar = CreateWidget<UHealthBar>(GetWorld(), HealthBarClass);
if (HealthBar)
{
HealthBar->AddToViewport();
}
}
}
The problem is that when other players log on, my character progress bar gets covered by other players’ one. I want like my character progress bar to be visualized. So I think I need to identify my character so that I can insert a condition in the method in order to add the progress bar to viewport.
How can I do this?
Thanks a lot.