Closed
Description
Describe the bug
Exception when LoadingScene with DontDestroyOnLoad NetObjects
To Reproduce
Steps to reproduce the behavior:
- Call DontDestroyOnLoad on a NetObject in one scene
- Call NetworkManager SceneManagement.LoadScene() on the server
- See error
Actual outcome
When you have NetObjects in DontDestroyOnLoad mode and you are switching scene an exception is fired in the SceneManagement part of NetCode.
Expected outcome
The scene should change without exception with the DontDestroyOnLoad NetObjects preserved.
Environment (please complete the following information):
- OS: MacOS 11.5.2
- Unity Version: 2020.3 and 2021.1
- NetCode Version: 0.2.0
- NetCode Commit: 4c166a6
Additional context
Exception : Exception: [SceneEventData- Scene Handle Mismatch] serverSceneHandle could not be found in ServerSceneHandleToClientSceneHandle