0
\$\begingroup\$

I'm creating multiplayer game with Photon. When player disconnects, especially master client does, every GameObject instantiated from Master client is gone, so I can prevent with this:

PhotonNetwork.autoCleanUpPlayerObjects = false;

Now GameObjects are still there even Master is gone, but what about their ownership? I needed to destroy some of enemies when they dies, but if master is gone and other player got selected as Master, is he automatically receive ownership of them too?

If not, is there a way to do that automatically? Any advice will very appreciate it!

\$\endgroup\$
  • \$\begingroup\$ Take a look at the Sky Arena package on the Asset store, it gives you all the necessary source code to build a multiplayer game with photon. \$\endgroup\$ – Nilmag Mar 13 '18 at 9:31
  • \$\begingroup\$ @Nilmag I can make multiplayer game. I just want to know about ownership when master left. And that asset isn't free. \$\endgroup\$ – modernator Mar 13 '18 at 12:42
1
\$\begingroup\$

I just asked to the Photon's forum, and I got the answer.

The point is it's not.

Setting autoCleanUpPlayerObjects will not transfer ownership to new master client automatically.

To do that, you must create GameObject with PhotonNetwork.InstantiateSceneObject, not PhotonNetwork.Instantiate.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.