Ownership transfer of SceneObjects on disconnecting MasterClient

Hello,

i am using PhotonNetwork.InstantiateSceneObject("BrickWall", t.position, t.rotation, 0, null); to let the MasterClient instantiate the destroyable world.
In Unity this SceneObjects are shown on MasterClient as
- Owner: Scene
- ViewID: 1
- Controlled Locally (master): yes

After the MasterClient is disconnecting, looks like the ownership of the SceneObjects get automatically transferred by PUN. After this the Ownersship is not anymore Scene for the new MasterClient:
- Owner: 2
- ViewID: 1
- Controlled Locally (master): yes

How to solve this problem? This should not be normal?

This is a problem for me because: If a bullet hits anything, i check if it hits the player itselfe, to ignore himselfe. (In my game the owner of the bullet should not be hit by it).
if (bulletOwnerId == other.photonView.ownerId) { //ignore }
In this case after the MasterClient disconnects and the ownership of the SceneObjects is transferred automatically, the new MasterClient can not hit any SceneObject anymore, because all SceneObjects have now the MasterClients OwnerID,

Answers

  • PhotonNetwork.autoCleanUpPlayerObjects = false; When you don't want the objects to dissapear when the master client leaves.