Between rooms

Options
There are two people in the room - First-in and Second-in. When the first one enters another room with enemies having a Photon View script, they are all initialized. But if the second one enters the first room to go to the next room, it becomes empty (not one enemy), only the character himself. I want to note that enemies with zero health value do not die, but become passive. And the characters enter the next room alone. I need to fix this problem, and make it so that if the second one enters the room, manages to pass to the first team for the first time, then the enemies do not disappear.
P.S: For transition between scenes I used Application.LoadLevel, and in each scene reset PhotonNetwork.LeaveRoom (); and changed PhotonNetwork.JoinOrCreateRoom (Application.loadedLevelName, new RoomOptions (), TypedLobby.Default); so, with this there is no problem.


Comments

  • [Deleted User]
    Options
    Hi @Pub,

    which Instantiation function do you use for creating the enemies? If you are using PhotonNetwork.Instantiate(...), the objects get removed automatically if the owner leaves the room, unless you are disabling CleanupCacheOnLeave in the RoomOptions. If you are using PhotonNetwork.InstantiateSceneObject(...) for instantiation, the objects will either get removed (if there is no new MasterClient available to take over the ownership of the objects) or 'stay alive' (if there is another client to take over the ownership of the objects).