How to have hundereds/thousands of objects with photonview and how to enable and disable photonview

Options
Title says it all, im working on a game where the player places blocks which other players can stand on, these blocks need a photonview to do this, however im having a few issues

having too many blocks with a photonview on them (aprox 300) will cause lots of lag for the player, this is to be expected but i only really need photonview to be active when the block is spawning as once it has spawned it becomes static, however there is no way to disable photonview on first glance, it appears theres no tick box next to it in the hierarchy if that makes sense

also, whats the maximum amount of objects which are allowed to have photonview as when i was stress testing earlier i noticed that having more than 500-600 would cause some of them to not appear on either players screen

any advice on how to accomplish this would be appreciated, I previously tried instantiating them but only the master client can instantiate to the scene and when a player left it would delete all their blocks, i made a discussion about it here
http://forum.photonengine.com/discussion/6984/keep-player-instantiated-objects-in-game-when-player-leaves-room#latest

Comments

  • vadim
    Options
    Try to keep PhotonView object count as small as possible. Use them only if complicated synchronization required. Putting PhotonView on every block is wasting of resources. Instead, synchronize array of blocks positions with RPC or room properties. Having this array, each client can easily update local (non-PhotonView) game objects.