Selective Visibility in Multiplayer Networking Games?

Hi community,

I’m trying to setup some kind of selective visibility in a multiplayer networking game.

To summarize what i’d like to achieve: The game itself is a simple checkpoint racing game where each player hast to pass trough the same array of checkpoints. The player that reaches the last checkpoint first wins the game.
Each player should only see his current desired checkpoint and the others should be invisible to him. Here an example:

  • The racing track consists of 20 checkpoints
  • Player 1 has passed 5 checkpoints and checkpoint 6 is his desired checkpoint. All the checkpoints except of checkpoint 6 should be invisible only to him
  • Player 2 has passed 2 checkpoints and checkpoint 3 his his desired checkpoint. He should only see his desired checkpoint, which is checkpoint 3

So what’s the best way to achieve this?

Thanks and best regards,
Daniel

Not entirely sure if this would work. But maybe set all the checkpoints to begin as hidden in game except checkpoint one.
Then on each checkpoint you would have some way of checking if the car has entered / gone past the checkpoint.

When it does it would fire a Boolean flag. Eg the car hits check point one, the car passes check point one . The bool hasPassedCheckpointOne becomes true this would fire a custom event ( set next next checkpoint)

In this event you would set checkpoint one to be hidden, and checkpoint two to change from hidden to shown. Repeat this process for each checkpoint.