- Home /
Question by
neverwill · May 25, 2018 at 09:26 PM ·
multiplayerinvisibleturn-basedinvisible-object
Setting up invisibility for a turn-based JRPG style multiplayer game
I'm implementing invisibility on a turn-based JRPG style multiplayer game. The approach that I thought of is just iterating through the list of players and setting the renderer to false:
void GoInvisible(){ // class Unit
foreach (Player player in players)
if (player.playerNumber != this.playerNumber)
gameObject.GetComponent<Renderer>().enabled = false;
}
I was wondering if there is a better approach, since it is a multiplayer game.
Comment