Hello, im making an inventory system on C++ and i need it to be replicated, everything works fine but when i add the interactionWidget that shows a widget just saying (Press E to interact) it shows on the client and the server. If i have 3 users and run as Listen server, it only shows on the one client and the server, as when on the server it only shows on the server.
void AOccultHUD::BeginPlay()
{
if (InteractionWidgetClass)
{
InteractionWidget = CreateWidget<UInteractionWidget>(GetWorld(),InteractionWidgetClass);
InteractionWidget->AddToViewport(-1);
InteractionWidget->SetVisibility(ESlateVisibility::Collapsed);
}
}
void AOccultHUD::ShowInteractionWidget()
{
if (InteractionWidget)
{
bIsMenuVisible = true;
InteractionWidget->SetVisibility(ESlateVisibility::Visible);
}
}
void AOccultHUD::HideInteractionWidget()
{
if (InteractionWidget)
{
bIsMenuVisible = false;
InteractionWidget->SetVisibility(ESlateVisibility::Collapsed);
}else
{
UE_LOG(LogTemp, Warning, TEXT("InteractionWidget is null in HideInteractionWidget."));
}
}
Thisi s how i call it.