I have an RPC function, that is passed an array of names by the server. It should change the scene to allow character selection. Changing the scene does work, however, I can’t seem to get the right camera object (which would have the character creation GUI attached).
Application.LoadLevel("ChooseCharacter");
Debug.Log(Camera.current.name);
ChooseCharacterGUI gui = Camera.current.GetComponent<ChooseCharacterGUI>();
gui.gameController = this;
Line 2 gives me “Main Camera Login” which indicates the camera that was active before Application.LoadLevel. Line 4 breaks my app as the gui reference is null.
Guess I have to wait a frame or something similar?