Mobs synchronization (photonView transfer after disconnect)

Options
Hello,

except for players I need my mobs (AI) to be synchronized (position, health, etc.).
So I decided I assign them a photonView and instantiate them for the first player who enters a room.
As long as he is online, there is no problem, but when he disconnects, the mobs disappear as well.

I was thinking maybe if I could pass the photonView ownership to someone else present in the room, it could work.
But how can I do that? Is there any way, how to prevent these mobs from destruction, even though they loose their owner?

Comments

  • vadim
    Options
    Hi,

    Use PhotonNetwork.InstantiateSceneObject() for creations of objects not owned by anyone. This call, subsequent updates and PhotonNetwork.Destroy() call should be made from master client (PhotonNetwork.isMasterClient). There is always one master client in the room. When current master leaves, next client in the room takes over.
  • Thank you, I tried that, but it does not work.
    See viewtopic.php?f=17&t=6171