Both isMine and owner are attributes of NetworkView. I did an experiment and found these:
(1)networkView.isMine is always true and networkView.owner is always Network.player at the network peer which created the networkview by calling Network.Instantiate();
(2)networkView.isMine is always false and networkView.owner isn’t Network.player at the network peer which doesn’t create the networkview.
So can i make this conclusion: isMine is always equivalent to owner?
Yes, isMine is allways true on the instance that instanciated the object. the networkplayer is the object that refers to a specific client object.
Thanks, appels.
I have a new FOUND: For any existing NetworkView instance, if a network peer assigns it a new NetworkViewID by calling Network.AllocateViewID() and spreads this new id to other peers, this network peer will become the owner.
So the peer which instantiates the NetworkView may not be the owner forever.
Nope, i don’t think so.
You don’t have control over it so you can’t assign another id to it.
But i’m not 100% sure about that.
If you want to swap owners of a view i would suggest you create an authoritative setup and have the server swap the owners.
My FOUND is based on my coding test. The test results speak that any peer can be the owner of an existing NetworkView by assigning it a new NetworkViewID, but your advice about authoritative setup is always the safe way:)
ah good to know, i havent been in that situation yet so i wasn’t sure.