How to hide actor in game only for Listen Server (without replicate to client)

Hello,

I got a question, how can you hide an actor in game, like the BP node “Set Actor Hidden In Game” without replicate it to client ? (In BP or C++)

Here is the engine declaration of the hidden property in UE5.0.2 :

UPROPERTY(Interp, EditAnywhere, Category=Rendering, BlueprintReadOnly, Replicated, meta=(AllowPrivateAccess="true", DisplayName="Actor Hidden In Game", SequencerTrackClass="MovieSceneVisibilityTrack"))
	uint8 bHidden:1;

My test is on server side ( Listen Server) and if the test is successful I need to toggle the visibility of an actor.

It works fine on the client (where only the actor on client side has its visibility toggle) but on the server, the server and the client have their visibility toggle.

Thanks a lot :slight_smile:

1 Like

Try using Actor->RootComponent->SetHiddenInGame, that sets bHiddenInGame directly in the component and that one is not replicated.

2 Likes

That’s nice, thanks, I think it is a good solution. I need now to handle all the child component that should not toggle (for example the capsule component for the character, I need it always hide in game). I will try to find something.