Hi,
I'm just seeking a clarification as to ownership rules when there's a master client switch.
Short Summary:
Since sceneobjects are technically owned by the master client, I'd expect photonView.isMine to return true when on the master client. This appears to be correct until there's a master client change. After the master client changes, photonView.isMine yields false on the new master client.
Full Context:
I want an AIController to take over when a player disconnects rather than destroying the player. So I've created SceneObjects for every player on the master client, then given the players control of their respective player object. When a player disconnects, the master client scans for players it owns via photonView.isMine (the disconnected player should no longer own the player object and SceneObjects are owned by the master client by default) and turns on the AIController. This system works (doesn't turn wrong players into AIs, turns all disconnected players to AIs) until the master client changes. I debugged my test conditions for turning a player to an AI and was surprised to see what was failing is photonView.isMine returning false. From what I've read SceneObjects are owned by the master client, so I assumed their ownership would transfer when master clients change.
Any insights into what's happening here or what I can do to keep a similar check?
I'm just seeking a clarification as to ownership rules when there's a master client switch.
Short Summary:
Since sceneobjects are technically owned by the master client, I'd expect photonView.isMine to return true when on the master client. This appears to be correct until there's a master client change. After the master client changes, photonView.isMine yields false on the new master client.
Full Context:
I want an AIController to take over when a player disconnects rather than destroying the player. So I've created SceneObjects for every player on the master client, then given the players control of their respective player object. When a player disconnects, the master client scans for players it owns via photonView.isMine (the disconnected player should no longer own the player object and SceneObjects are owned by the master client by default) and turns on the AIController. This system works (doesn't turn wrong players into AIs, turns all disconnected players to AIs) until the master client changes. I debugged my test conditions for turning a player to an AI and was surprised to see what was failing is photonView.isMine returning false. From what I've read SceneObjects are owned by the master client, so I assumed their ownership would transfer when master clients change.
Any insights into what's happening here or what I can do to keep a similar check?