Time for action – preparing the Clock Script

Open your Robot Repair game project and make sure you're in the game Scene. As we've done in earlier chapters, we'll create an empty GameObject and glue some code to it.

  1. Navigate to GameObject | Create Empty.
  2. Rename the empty GameObject Clock.
  3. Create a new JavaScript and name it ClockScript.
  4. Drag-and-drop the ClockScript onto the Clock GameObject.

No problem! We know the drill by now—we've got a GameObject ready to go with an empty script where we'll put all of our clock code.

Get Unity 4.x Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.