x


Specific Rendering Per Player In Multiplayer

Hi,

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?

more ▼

asked May 09 '12 at 01:48 PM

NickWalker12 gravatar image

NickWalker12
122 3 6 9

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.

May 09 '12 at 04:30 PM asafsitner

Cheers. I was worried you might say that. I was correct about render layers though? As the only way to have player specific rendering...

May 09 '12 at 08:57 PM NickWalker12

Either that or turning the renderer component off for all unwanted objects.

May 10 '12 at 02:38 PM asafsitner
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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. "

more ▼

answered May 25 '12 at 07:41 PM

NickWalker12 gravatar image

NickWalker12
122 3 6 9

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4135
x679
x329
x65

asked: May 09 '12 at 01:48 PM

Seen: 523 times

Last Updated: May 25 '12 at 07:41 PM