Global class of root scene doesn't start


#1

Hello, i have a small problem that i would like to understand, i have a class that contains the global game variables that should be available in all scenes, so i placed this class in the root scene, if i try to load something from this class when i set a child scene as default scene, i have a nullreferenceexception that means it hasn’t been added to the static class containing a reference to the instance, when i set as default scene the scene containing the class and make that the class loads the child scene at runtime, i have an exception because the root scene doesn’t contain camera

what could i do ?


#2

Could you elaborate? I’m not sure to understand what you are talking about. Maybe some screenshots and code samples…


#3

I have a root parent scene containing an entity that contains a script named MainScene
if i set as default scene TestScene,which is a child of MainScene, the script won’t start,
however, if i set as default scene the MainScene, i get an error saying that there is no camera assigned to the camera slot for rendering
this is the scene tree