Time for action - prepare 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. Go to GameObject | Create Empty.
  2. Rename the empty Game Object Clock.
  3. Create a new JavaScript and name it clockScript.
  4. Drag-and-drop the clockScript onto the Clock Game Object.

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

Get Unity 3D Game Development by Example 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.