JordanJ
Normal12mo ago
22 replies
Jordan

Best practice for scene changing while connecting to a room

I'm making the title screen for my game rn, and the idea is that the user would enter in a room name in the UI, try to connect, and then change scenes to the game when the connection is successful. However, what is happening is that upon a successful connection, all the Realtime prefabs are spawned in the title screen scene and then promptly destroyed after changing scenes to the actual game scene.

What is the way to fix this so that I can connect to the room in the title screen and the objects aren't spawned until after I change scenes? Ideally some way in the title screen to check if a room exists before connecting would be awesome, as then the logic for actually connecting can be done after the scene change. Is that possible?
Was this page helpful?