Specific Rendering Per Player In Multiplayer


I’m doing a little bit of rendering optimization and I was wondering;

In a multiplayer game, how can you turn off/on rendering for a single player?

More specifically, can I do this:

ObjectOnlyViewableByPlayerOne.gameobject.renderer.enabled = true;

I’m pretty sure I’ll need render layers, and, in which case, can you add layers in real time? Depending on the number of players, add rendering layers?

Answer credit to asafsitner

" You cannot change layers at runtime. You can assign objects to layers at runtime however, so you can just prepare the maximum number of layers you’ll need and assign each one to a player at runtime. "