How replicate pawn/actor only to specific players and not everyone?

How replicate pawn/actor only to specific players and not everyone?

Core idea behind this is partial realization for fog of war. To prevent maphacks it would be better to check if one player’s units see enemy units, then server replicate enemy units to player, who see them.

You need to detect if a the Pawn/Actor is in the fog of war for the specific Player, or not.

I would call a function on my PlayerCharacter (ServerSide), that checks if other units on the map are in the fog of war or not.
Then i would call a ClientFunction that only updates the visibility of these Actors. And you will need to do this for every
Player. And also i guess for every tick

OR you let the Actor tell the Server, that he is now invisible/visible for a specific player and the server goes on and set the
visibility for him.

For the “only a specific player”, you will want to use the PlayerController of the Player who gets the update.

So the Fog of War Actor/Pawn has a list of all PlayerCharacters and checks if he is visible for them or not.
If the status changes, the Actor/Pawn tells the Server to update his visibility exactly for this Player by
providing him with the PlayerController of this Character and a reference to the Actor/Pawn it self.
NOTE: This is all happening on the Server so far. The List and the “server pls do something” is all on the
server, so by now, you don’t need an RPC.

But now, to change the visibility, you will need an RPC. It should be located in the PlayerController Class.
Just call a Server -> Client function, that passes the reference of the Actor/Pawn and inside of the RPC,
you take the Actor/Pawn and set its Meshs Visibility to true/false. The bool could also be a parameter for the

Epic has a tutorial of something like this on their youtube channel. It is on a video called network relevancy.

Hm, network relevancy is only covering the distance i guess. But yes, this is also some kind of an approach