O'Reilly logo

Creating E-Learning Games with Unity by David Horachek

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

Creating the raceStartup Prefab

Recall that the second Prefab that is enabled when the popup_Level2Start windows is clicked, is the raceStartup Prefab. This object will commence the start of the other racers, leaving room for an eventual countdown clock. Let's start creating the raceStartup Prefab by performing the following steps:

  1. Create a new empty GameObject named RaceStartup.
  2. Create a new script named RaceStarterScript, and add an instance of it to the raceStartup class.
  3. This class should have a number of public variables to permit the tweaking of the race start.
  4. In the following line of code, stageTime is the amount of time each stage lasts:
    public float stageTime = 2.0f;
  5. In the following line of code, numStates is the number of states (of duration ...

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