In the Build Settings I have two scenes at index 0 and index 1:
Then in the Hierarchy I have the two scenes: The active scene is the MainMenu:
In the StartGameButton I added to it a script component. In the script:
public class LoadSceneOnClick : MonoBehaviour
public void LoadByIndex(int sceneIndex)
And this is the StartGameButton Inspector:
I dragged the script on the OnClick I selected the function LoadSceneOnClick And set the index to 1
When the game start and I click on the button it stay on the Main Menu scene and not loading anything.
The problem I guess is that I'm getting error in the game No cameras rendering:
The problem is that when I'm running the game and it start from the main menu scene in the space station scene I'm enable false the Player and the Player is a first person character with a camera:
You can see in the Inspector that the Player is unchecked the Player is not enabled. If I will enable the Player and even if the main menu scene is the active one it will show me the player and the player camera and not the main menu. So I had to turn off the Player.
The question now is where by script do I enable back the Player when it's loading the scene ?
Inside the LoadSceneOnClick script ?