How do not destroy objects when the owner exit

Options
Hello everyone, I am working on a multiplayer game. And I ran into a small problem, my game is a sandbox, something similar to minecraft, and I create objects using PhotonNetwork.Instantiate, and as I later noticed, I do it wrong, because when a player comes out, all the objects created by him destroyed, maybe i must use the PhotonNetwork.InstantiateSceneObject ? But it creates objects only if player is a MasterClient, but I need all players to create objects without exception, maybe i need make some kind of request should be made to the MasterClient? If so, how ???? But in short, my question is: How not to destroy objects when their owner leaves ?

Thank you in advance !!! :)

P.S : Sorry for my English :/

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Feelkep,

    Thank you for choosing Photon!

    Try:

    - creating rooms with roomOptions.CleanupCacheOnLeave = false
    - transfer ownership before leaving
  • Feelkep
    Feelkep
    edited September 2019
    Options
    Thank you for quickly answer !
    I tried use roomOptions.CleanupCacheOnLeave = false; , and it worked, instantiated objects don't destroy, it is cool, but when I try disconnect from photon(just close game) my player don't destroed, maybe I must use special destroy for my player?

    Here video demonstration : https://youtu.be/1uwQelO6Hy4
  • Feelkep
    Options
    Wait for you answer ! :)
  • Feelkep
    Options
    The problem is solved, if anyone is interested I will tell about it:
    ===================================================
    The problem was solved through the InstantiateSceneObject method, and it works fine, the problem was in my function which destroy the my player prefab, I did not do it right exit from server therefore my player prefab does not could be removed from room, and now my player correctly destroyed, but his instantiated objects don't remove, this result fine me :) Hope this answer help you :D
    P.S Sorry for my English :)