Hide actor for player at listen server only?


How can I hide an actor for an arbitrary number of players/clients including the player at the listen server? The problem is that the “hidden” value is replicated from the server so e.g. if only the player at the listen server shouldn’t see the actor, no one can see it since its replicated down to the clients.

It seems like this functionality is totally missing unless the hidden property is related to the current owner or I’m I wrong? Is the only way of solving this to modify the AActors source code? I can think of many games that could need this behavior e.g. a MOBA.

Thanks in advance!

Would this help you?

UFUNCTION(BlueprintCallable, Category="Rendering")
void SetOnlyOwnerSee
    bool bNewOnlyOwnerSee

Unfortunately the actor can’t have any specific owner in my case. It must be able to be hidden to any combination of players connected, otherwise that could have worked.

I have now edited the question to make it less ambiguous.

Thanks anyway!

This is kind of old, but I ran across this problem and wanted to provide an answer for those who come looking.

Instead of using SetActorHiddenInGame() I just did GetCapsuleComponent()->SetVisibility(!bIsHidden, true).