Stopping "Set Actor Hidden In Game" from Replicating to client automatically

“Set Actor Hidden In Game” seems to be automatically replicated back to the client if its executed on the server. I imagine this is part of the built-in actor replication in the engine, but I need actors to have separate hidden states on each client based on whether their units are in range/line of sight of the other player’s units, etc.

I can work around this by manually hiding the mesh and other components instead of hiding the entire actor, but I was wondering if there’s an easy way to stop Set Actor Hidden In Game from replicating since that would be easier and cleaner.

Here’s the quick test I set up to verify this. When I press F, the unit disappears from all players.

Thanks

1 Like

Hey, im having the same issue, i don’t think it’s possible to stop it from replicating in blueprint. The way i do it, is i have a isVisible bool set to rep notify and inside the OnRep function i check for hasAuthority( i want remote) and isLocallyControlled (i want is not ) and set actor hidden in game to isVisible. You don’t have to manually check every mesh this way, hope it helps.

I ended up putting all the stuff I want to hide under the same parent component and just using Set Visibility (with Propagate to Children checked) instead and it works fine.

1 Like