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\$
2
  • \$\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
    Commented Mar 13, 2018 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
    Commented Mar 13, 2018 at 12:42

1 Answer 1

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\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .