An issue with SetActiveScene and Runner.shutdown
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on Fusion.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
An issue with SetActiveScene and Runner.shutdown
gklyu
2023-04-01 07:50:19
Odd behavior... I have only 3 scenes in my loop: Menu, GetReady, Gameplay.
==========
- Menu scene
user inputs a session name
executes runner.StartGame to go to the GetReady scene
- GetReady scene
player prefabs are spawned.
sets DontDestroyOnLoad for all players
then executes runner.SetActiveScene to go to the Gameplay scene.
- Gameplay scene
- contains a button to shutdown and destroy the runner, and return to the Menu scene.
=========
No problems on the first loop, until I click the button to shutdown and destroy the runner, and redo the loop.
When I reach the Gameplay scene the second time, I get the error:
[Fusion] [NetworkSceneManager] Network runner: Failed to switch scenes: System.InvalidOperationException: Failed to load scene [Scene:1]: async op failed at Fusion.NetworkSceneManagerDefault+
===========================
Also, I only got this error after creating the GetReady scene, between the Menu and Gameplay scenes. Without the GetReady scene, the Menu scene executed runner.StartGame directly to the Gameplay scene and I could loop thru multiple times.
I cant figure out why switching scenes is failing after the first loop?
Thank you in advance for any help.
Comments
Isaac_Augusto
2023-04-10 11:48:14
Hi gklyu,
That's definitely odd, I don't see anything wrong.
The gameplay scene is the scene that has index 1? Can you share the full log? Also, if possible, describe better each step with code snippets can help us debugging.
Isaac Augusto
Photon Fusion Team
Back to top