I'm using photon pun. I have a spawner script which instantiates the eatables in the gameplay and right after the instantiation, im transferring its ownership to null. The instantiated game objects's photon view component's ownership transfer variable is set to takeover.
But, my instantiated game object is still getting destroyed with the master client, how do i stop this from happening? Also I don't have any IPunOwnershipCallbacks
in the instantiated game object script.
By default, all GameObjects created by one player will be destroyed when he/she leaves.
Are you using local multiplayer? Because when the server is the master client, you have a different problem if that one is disconnecting. Did you create the GameObjects withInstantiateSceneObject()
? Or try settingPhotonNetwork.autoCleanUpPlayerObjects
to false. But with no more code from you, we can only guess \$\endgroup\$PhotonNetwork.autoCleanUpPlayerObjects
. Although this was missing for me. Then I stumbled upon this post and it finally worked for me! \$\endgroup\$