Hey guys,
I'm working on getting saving and loading working in my game (using whydoidoit's Serializer, but that may not matter in this case), and I'm running into a problem.
I can't have the camera duplicate itself when a saved level is loaded, or at any instance have two of the same camera in scene. To combat this, I made my camera a prefab [and removed it from the scene] and have a Manager game object with an FSM on it to check if it exists in scene - if it doesn't exist, it'll create one. If it does exist, it'll destroy itself.
My problem is that other objects reference scripts on my camera object (that do need to be on the camera) and I'm getting Null References on said objects that are trying to reference the camera components at runtime.
Is there a way to easily delay OnStart calls from those other game objects so I can avoid this issue? I'd like to avoid Coroutines if possible.
OR
Is there a good way to make sure the 'check if exists then create/destroy' FSM runs first thing? I've heard about creating sort of "empty" scenes to load into first before the scene in question, but I don't know much about that or if it pertains.
I really look forward to any advice! I'd be very grateful.