Reputation: 37
I have 2 scenes in my game. 1st for menu and 2nd for Game itself. There is one button on screen called "Play". This button will let player load Game Scene. And if user press Escape from Game Scene, it will load Main Menu. I've uploaded code for it below,
if (Input.GetKeyDown (KeyCode.Escape)) {
SceneManager.LoadScene ("Menu");
}
The above code(Written in Update()) exits the Game Scene, But The player remains on screen. And so if I again press Play, the Game Scene does not display player. I've searched for it much, but I can't find any understandable reason. Can anyone help me please.
Upvotes: 0
Views: 103
Reputation: 1586
The problem could be that you have called DontDestroyOnLoad(player) somewhere.
Have you tried making a different scene and loading that one to test if that also happens?
Upvotes: 2