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 Time object

The Time object will implement the game's clock functionality in this level. If the time ever reaches zero, this class will display the mission failed pop up. Recall that the source of the added pressure this time around is the clock ticking down to zero. We want this because a little pressure makes the game fun and encourages cognitive flow. Perform the following steps to create the Time object:

  1. Create a new script named TimeScript.cs. Add an instance of it to a new GameObject of type GUIText. Place GUIText on the left-hand side of the screen opposite the score. Note, this is done by adjusting the PixelOffset field of the GUIText component, and not by moving the transform (this is one of the few exceptions to the rule ...

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