With 'Enter Play Mode Options' checked, the CharSelect scene is not loaded immediately when the host is started for the first time in the editor.
Describe the bug Not high priority but the fix could be quick. With 'Enter Play Mode Options' checked, the CharSelect scene is not loaded immediately when the host is started for the first time in the editor. Reload Domain and Reload Scene are unchecked.
Having Reload Scene checked only, can kind of resolve this issue. The problem is not with Reload Domain as I've tried to reset some static fields and methods already in ServerGameNetPortal, ClientGameNetPortal, SessionManager etc.
I've narrowed down the issue to SceneLoaderWrapper.cs LoadScene method.
if (
IsSpawned && // <<< THIS
IsNetworkSceneManagementEnabled &&
!NetworkManager.ShutdownInProgress
) {
...
}
IsSpawned is false on the first Play. When it is true, you get to the CharSelect
scene correctly. I'm not sure why this condition is there.
To Reproduce Steps to reproduce the behavior:
- With 'Enter Play Mode Options' checked, click on 'Start with Direct IP'.
- Get to the 'Host With IP' (localhost) tab in the Main Menu scene.
- With the default localhost IP address and port, click on the start 'Host' button.
- The loading spinner spins and 'RecvConnectFinished Got status: Success' is logged in the console. You don't get to the CharSelect scene on the first Play mode.
- Stop the Play mode.
- Try steps 1 to 3 again without changing anything else.
- You can now get to the CharSelect scene immediately.
Expected behavior You get to the CharSelect scene immediately (like you would with 'Enter Play Mode Options' unchecked).
Screenshots
Environment (please complete the following information):
- OS: Windows 10
- Unity Version: 2021.3.2f1
- BossRoom Version: v1.3.0-pre
Additional context
Not sure if removing IsSpawned condition will be an adequate fix. Also not sure if Reload Domain and Reload Scene being unchecked
is intended to be supported by NetCode.
Hey @wlwl2 Setting this as a feature request, as we never used playmode options in boss room. If you think IsSpawned isn't getting reset properly between play sessions, can you log this as an NGO bug please? NGO and UTP should support playmode options already.
You can add NGO issues here https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues
Submitted the bug report. Good job with having scenes in Boss Room! I forgot to mention that earlier.
Thanks!