O'Reilly logo

Unity 5.x Game Development Blueprints by John P. Doran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Restarting the game

There may come a time in a game when a player makes a mistake and would like to restart the level in the game they're currently playing. If you prepared your project ahead of time like we have, it's actually quite easy to get this functionality placed into your game. With that being said, let's implement that functionality now! We will perform the following steps:

  1. Select the Panel object and from there, create an empty child and drag it in the hierarchy to be the top child from the list. To that empty game object, rename it to Top Row and add a Horizontal Layout Group component to it.
  2. Next, drag and drop Resume object to it to make it a child and then duplicate it (Ctrl + D) to create a copy.
  3. As you can see, we now have two buttons ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required