Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Third Party [PHOTON] Destroy scene object

Discussion in 'Multiplayer' started by shuskry, Apr 3, 2017.

  1. shuskry


    Oct 10, 2015
    Hi everybody ! :)

    First, i use Photon network in my project ! :)

    I have some trouble with Scene object,
    -i use a Spawn system to create Scene object (monster)
    -I know that scene object can be destroy exclusively by the master client cause the ownsership of a scene object is the master

    so , how can i do if a other client killed a monster ? is it possible to transfer the ownership of a sceneobject to a other client ?
    I read the basic tutorial of PUN to transfer ownership but i don't really understand how it's work and how to do that ...:/

    Maybe , my spawn system is not the good way ?

    Thx for helping !
    Have a good day !
  2. UmarFarooq007


    May 10, 2019
    So, no one replied to you in a long a time:)
  3. Munchy2007


    Jun 16, 2013
    And your reply was oh so helpful, and it being your first post, I'd ban you if I were a mod!

    As you've seen fit to dredge this up, in case anyone else is struggling with the same issue and reads this, ownership can be transferred using RequestOwnership(), or you could send an RPC to the MasterClient instructing it to delete it for you.

    I think the first option is preferred, due to the fact that the MasterClient can disconnect before receiving the RPC in which case it would be lost.
    Joe-Censored likes this.
  4. Joe-Censored


    Mar 26, 2013
    That happens when no one who sees the thread knows the answer in the short time before the question drops lower on the page. Please don't necro the other thousands of similar threads.
    shuskry likes this.