Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question [Pun2] Finding Owner to destroy object

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

  1. Chen5464

    Chen5464

    Joined:
    Jan 14, 2018
    Posts:
    14
    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:
    2,957
    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:
    14
    Amazing! That What I needed ! thank you so much!
     
    Last edited: Nov 18, 2022