Photon Automatically Destroy Prefabs On Disconnected Side

Options
RoomOptions :
RoomOptions roomOps = new RoomOptions();
		roomOps.IsVisible = true;
		roomOps.IsOpen = true;
		roomOps.MaxPlayers = 2;
		roomOps.PlayerTtl = 60000;
		roomOps.EmptyRoomTtl = 30000;
		roomOps.CleanupCacheOnLeave = false;

Pun v2.22

Is there any way to keep photon instantiated prefab on disconnected side?

Comments

  • Tobias
    Options
    The option CleanupCacheOnLeave = false should do that.
    It could be that you don't set those options in CreateRoom or something else could destroy the objects.

    In a quick test, this worked for me in 2.27.
  • L3sc
    L3sc
    edited January 2021
    Options
    -I never called destroy prefab
    -room ops added with create room.
    RoomOptions roomOps = new RoomOptions();
    		roomOps.IsVisible = true;
    		roomOps.IsOpen = true;
    		roomOps.MaxPlayers = 2;
    		roomOps.PlayerTtl = 60000;
    		roomOps.EmptyRoomTtl = 30000;
    		roomOps.CleanupCacheOnLeave = false;
    		PhotonNetwork.CreateRoom("anything", roomOps);
    

    When I disconnect Photon player instantiated from me and other client player destroyed. But for other side(client) who still in the game both prefab there. Is this normal behaviour or do I need to update my pun package?

    Edit: I checked on start both side CleanupCacheOnLeave and it's false

    @Tobias
  • Tobias
    Options
    PUN should not destroy the networked objects on the client that gets disconnected (neither on the client which remains).
    Does any code reload the scene, maybe?

    Yes, you should update the PUN package.