Reset Button
game on
Sun Valley, California Member, PRO Posts: 79
Hi Guys,
I have three scenes in my game, "Main Menu", "Game", & the "Game Over" scene. I made a "restart button" in the "Game Over" scene to take you to the "Game" scene, so you can replay. But instead of starting a "New Game", it like continuing from where you left off.
Is there a way to add something in the "restart" button, that really ends the old game and starts fresh a new game? I did try the "Reset Game" Attribute (and it worked), but it keeps taking me to the "Main Menu" (1st) scene instead of the "Game" (2nd) scene.
Thanks,
Comments
You will need to reset all your attributes and tables when you restart the game. Create an actor and put it off scene on the Game scene and use it only for resetting your attributes. Because GS loads from the bottom up make sure it is the last actor in the Scene/Layers tree.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
I have the game set, when "Main actor" dies he falls on a "Destroy actor" which spawns "Game Over" scene. Can't I just add a command that also says, "when "Main actor" collides with "Destroy actor" game is "over" or reset "new game?"
Is there a good tutorial on how to end a game?
It's a computer and it has no idea unless you tell it. No behaviour can know what attributes you created or their values. To restart the game you will have to reset any attributes that are require to start a new game to the same values you started from when you opened the game the first time.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
Just add the new actor - Reset actor and where actor gets destroyed change attribute Gameover to true.
In the new actor if attribute game.gameover is true reset your attributes
Developer For BLUNTentertainment - Feel Free To Message Me! - Free Beginner Templates!