Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Yeah I noticed restart wasn’t working just before I had to submit. I couldn’t figure it out before the submission time ended.

How you handle it(in code)?

(1 edit)

#in my game over script in the gameOver scene

var mainScene = preload(“scene.tscn”).instantiate()

func playAgain():

    get_tree().root.add_child(mainScene)

    self.queue_free()


#in the main scene 
var gameOverScene = preload(“gameOver.tscn”).instantiate()

func gameOver():

    get_tree().root.add_child(gameOverScene)

    mainScene.queue_free()

You can use https://docs.godotengine.org/en/stable/classes/class_scenetree.html#class-scenet...