O'Reilly logo

Unity 4.x Cookbook by Matt Smith, Chico Queiroz

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

Displaying an analogue clock

Analogue clocks are often more visually appealing, and often worth the little extra effort in creating the GUI elements for the clock-face and hands.

Displaying an analogue clock

How to do it...

To display an analogue clock, please follow these steps:

  1. Create a new scene, and add a Directional light in the direction of the camera.
  2. Create the clock face, this is a Cylinder with the following properties:
    • Position (0, 0, 3)
    • Rotation (90, 0, 0)
    • Scale (13, 0.1, 13)
  3. Create three differently colored or textured materials (for example, red, green, and blue), to be applied to the hands of the clock. Name these materials as m_seconds, m_minutes, and m_hours.
  4. Create ...

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