Pass ownership on disconnect.

Options
Hey everyone.

So my question is when a player disconnects, is there a way for the master to automatically take ownership of an object rather than the object being destroyed.

The issue I'm facing is all Owner objects destroy when the player leaves.

If I instantiate as a scene object, then only the master can control the object though that's not always the player.
The only way I can see it working with the Master client is if I set up RPCs for every little thing. Which I don't want to do.

For now, I'll leave as it but I hope someone has an answer :)


Answers

  • Instead of taking ownership of an object, you can write PhotonNetwork.instantiateSceneObject() and the instantiated object will be in there as long as the room has someone in it.
  • Harley
    Options

    Instead of taking ownership of an object, you can write PhotonNetwork.instantiateSceneObject() and the instantiated object will be in there as long as the room has someone in it.

    Hey thanks for the feedback, I ended up finding a solution in room properties which automatically switches to a scene object when the player leaves. That works for my situation.