- Home /
unet custom observers for networked object .
hi . i made a simple network game with HLAPI component (NetworkManager , network transform , network hud,...) everything works fine and four players join in a server now i need to say " player 1 only see player 3 and player 2 only see player 4 and they must not see other player" in the same server they joined . i see NetworkIdentity.observers but it's read only .
Answer by MrMeows · Oct 25, 2015 at 05:12 AM
Give each player its own rendering layer. Then, set the layerMask of each player's camera to the layers you want that player to see. You will need some GameObject to store an array of players and corresponding arrays of layers and layerMasks. When a player joins, set its layer and layerMask to the respective items in the arrays. There may be better ways to do this, but this is what I am using.
No , with the word "see" i mean i dont want any data transfer from server to client by other players but only those 2 players . i need the server to pick 2 players from all players in the server and all other players only exist in server not in those 2 client and those 2 players can play togather .
Your answer

Follow this Question
Related Questions
How to watch in client applications what it is happening in the server one? 0 Answers
Network and Server options 0 Answers
Animation & sound over network 1 Answer
Syncing terrain over Network 0 Answers