PhotonView.RequestOwnership C# (CSharp) Method

RequestOwnership() public method

Depending on the PhotonView's ownershipTransfer setting, any client can request to become owner of the PhotonView.
Requesting ownership can give you control over a PhotonView, if the ownershipTransfer setting allows that. The current owner might have to implement IPunCallbacks.OnOwnershipRequest to react to the ownership request. The owner/controller of a PhotonView is also the client which sends position updates of the GameObject.
public RequestOwnership ( ) : void
return void
    public void RequestOwnership()
    {
        PhotonNetwork.networkingPeer.RequestOwnership(this.viewID, this.ownerId);
    }

Usage Example

Example #1
0
 /// <summary>
 ///
 /// </summary>
 void Start()
 {
     if (PhotonNetwork.isMasterClient && view.owner == null)
     {
         view.RequestOwnership();
     }
 }
All Usage Examples Of PhotonView::RequestOwnership