- Home /
The question is answered, right answer was accepted
camera layer issue, multiplayer.
hi,
im having an issue with setting up and disabling certain layers in multiplayer. i set it up so that i set up 2 layers, one to be displayed on my second camera (fps hands and what not) and the other to not show up on my camera. i made a c# script to set the layers when the player gets instantiated.
problem is, now i dont see other players. if someone can help me out, and/or point me in the right direction, id greatly appreciate it. thanks.
Impossible to help you without any further information
If you want help, you're going to have to be a lot more percise
Answer by R1pnd1p · Oct 21, 2013 at 02:26 AM
MUST READ! many, many people have tried. and many many people have failed. but not I! I HAVE SUCCEEDED! and you shall too. if you are having problems with layers in your game with fps, you have come to the right place! i will fulfill your quest of enlightenment, i am the answer to your doubts! i am the KEY TO YOUR HEART! ....ok forget that last part.
all you have to do is disable the render mesh locally. the c# script for it is
MeshRenderer[] mrs = myPlayer.GetComponentsInChildren<MeshRenderer>();
foreach(MeshRenderer mr in mrs) {
mr.enabled = false;
}
SkinnedMeshRenderer[] smrs = myPlayer.GetComponentsInChildren<SkinnedMeshRenderer>();
foreach(SkinnedMeshRenderer smr in smrs) {
smr.enabled = false;
}
study this! this is the key....AND your destiny!
good luck all, god speed.
oh and one more thing. you only need a layer for your hand/gun display! boom! im so damn happy i figured it out.
Disabling and enabling renderers is quite expensive. I would suggest avoiding this approach. If you don't want something to get rendered simply put it in a different layer, then have the camera not render that layer
you CANNOT do that in a multiplayer game, if something is labeled as "do not display" on ANY camera, it wont display for anyone, not just you.
plus, you apply this to a start function when a character gets instantiated, and when you disable the render, its only client side and local, it does send any information to the network.
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Network multiplayer chess/battleship game cameras 2 Answers
Networking Camera 1 Answer
Bug From Camera Multiplayer Network Game 0 Answers
Multiplayer| Attaching camera to player (if i am the owner 1 Answer