Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Third Party [Pun2] Finding Owner to destroy object

Discussion in 'Multiplayer' started by Chen5464, Nov 18, 2022.

  1. Chen5464

    Chen5464

    Joined:
    Jan 14, 2018
    Posts:
    15
    Is there a way for me to find the owner of a gameobject so I can send RPC to that owner to destroy that gameobject using PhotonNetwork?
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    Yes, the PhotonView.Controller is who you want to send the RPC to.
    It can be used as second parameter of RPC(string methodName, Player targetPlayer, params object[] parameters).
     
  3. Chen5464

    Chen5464

    Joined:
    Jan 14, 2018
    Posts:
    15
    Amazing! That What I needed ! thank you so much!
     
    Last edited: Nov 18, 2022