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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    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,022
    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