I couldn't find any information on managing spawns based on player zone/scene.
Basically, my whole game world will be in a single scene but 100s of players will be connected and I have internal means (i.e ZoneId) to group these players.
TargetRPC works good for this case because I can just send messages to connections/players in the same zone, when a player switches zones, I just load the latest info about zone for the player.
However, NetworkServer.Spawn manages spawning in all connections/players and the doc tells me to use a custom Visibility checker (similar to the Promixity one), that would work for visibility, but it would load the gameObject for all clients regardless.
Wouldn't that hurt performance? Loading the same gameObjects for all the clients, it could be in the 10000s?
Any alternatives? Would be nice to assign Clients a custom zone id (Guid) and Unet could manage spawns and even network commands it for us.
Answer by msivri
Ok, after reading the source code for UNEt, i think what I want can be done via Observers and OnRebuildObservers.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
3 People are following this question.
Unity networking tutorial?
rpc / head rotation
What's the best way to connect and communicate between an Android Unity app and a non-Unity Windows C++ application over LAN?
[UNET] How to pass control back to server