Question by
Ale_ga · Jul 08, 2021 at 10:57 PM ·
playerscenedontdestroyonloaddestroy objectscene-change
Destroyed object in DontDestroyOnLoad does not recreate in its main scene
I am trying to reset the game when I press R, my player is created in Scene1 ie the main scene and then it goes into the DontDestroyOnLoad scene so as not to be destroyed in the scene change, so I have to destroy it with Destroy .Object and then I reset the scenes, the problem is that when I destroy the player and then reset the scenes, the player does not recreate himself in scene1 and tells me: Display 1 no camera rending. (the player should recreate himself in scene1 because at the beginning of the game he is present in scene1 and then switches to the DonDestroyOnLoad scene) what's the problem? how do i fix it? if (Input.GetKeyDown(KeyCode.R)) { Destroy(player); SceneManager.LoadScene(0); }
Comment