Currently, there are evident race cases and unknowns involved with interaction between lua scripted game logic and scenes because issues with scene state. The lifetime of a scene and all of its objects needs to be made more concrete.
For example:
LoadScene -> Scene is now created -> initialize all gameobjects -> call initialize (scripting) on all objects -> continue with gameplay.
There was an issue with the current scene not being set correctly in SceneManager due to the current scene loading code, and trying to create or delete objects before a scene has been initialized or made current causes issues. This needs to be addressed.
Currently, there are evident race cases and unknowns involved with interaction between lua scripted game logic and scenes because issues with scene state. The lifetime of a scene and all of its objects needs to be made more concrete.
For example:
LoadScene -> Scene is now created -> initialize all gameobjects -> call initialize (scripting) on all objects -> continue with gameplay.
There was an issue with the current scene not being set correctly in SceneManager due to the current scene loading code, and trying to create or delete objects before a scene has been initialized or made current causes issues. This needs to be addressed.