- Home /
Question by
quieresss · Dec 14, 2020 at 10:19 AM ·
scripting problemscripting beginner
how to restart a game
to reset the game, i'm using this line of code:
SceneManager.LoadScene( SceneManager.GetActiveScene().name );
everytime this function is called, this happens: https://www.youtube.com/watch?v=r218kr3g594&feature=youtu.be my game has only one scene, and i don't recall naming it at any point, and when i put the name of the game in the .name section, my script editor takes it as an error. what am i doing wrong?
Comment
When do you call this method? I suspect you call it constantly, hence the behaviour you are seeing.