Description
I have a scene with thousands of NetworkObjects, but only a few of them needs to be active at a time.
If they are not spawned, everything would work smoothly, but scene objects are spawned automatically according to :
https://docs-multiplayer.unity3d.com/netcode/current/basics/object-spawning/index.html
How do I prevent this from happening? Is there a variable on the NetworkObject to prevent auto spawning?
Otherwise I don't see how it's possible to use Netcode with a large number of NetworkObjects.
I'd like to be able to call NetworkObject.Spawn() myself and manage which ones should be synced. Instead of spawning everything and lagging the game. Anyone knows how to do this?
EDIT
I tried to use CheckObjectVisibility, but the network code still loops on those objects every network tick, because those objects are still in the SpawnedObjects array, affecting performance. When an object isn't Spawned this does not happen. So I really need a way to not Spawn scene objects automatically.