Can you keep the user in the room even if the scene changes?

hello.

I am developing in Unity using Photon and Photon Voice.
We are using 3 scenes, and in the second scene we create a voice room and engage users.
However, at the moment of going to the third scene, the prefabs of the users who were chatting in the voice room were deleted and the conversation was cut off.
I'm still a programming newbie, so I don't know how to solve this situation.
When I go to the 3rd scene and when I return to the 2nd scene, I hope the conversation will continue until the user directly presses the Leave Room button.
What would you like to do?

Thanks.

Answers

  • create a folder not to be destroyed, this is a function of unity.
    DontDestroyOnLoad (gameObject);
    Research it
    maybe if you keep this folder with all the components and objects that you don't want to be destroyed, your problem will be solved.
  • Hi @haseo,

    Thank you for choosing Photon and sorry for the delayed answer, sometimes we do miss some forum discussions!

    As @Alberto already pointed out there is the DDOL (Don't Destroy On Load) solution to make GameObjects persist across scenes.
    There is also the option to load scenes additively although it makes the previously loaded scene(s) remain in whole.
Sign In or Register to comment.