O'Reilly logo

Unity 5.x Game Development Blueprints by John P. Doran

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

Adding in Score/High score

Now that the game has the start and ending, let's make it so that we can gain a score whenever we hit a duck:

  1. From the Hierarchy tab, duplicate the Time Text object and rename it to Score Text. Go to the Rect Transform's Anchor Presets menu, hold down Alt + Shift, and click on the top-left option. Then, change Pos X to 10 and Pos Y to -10 to push it a bit off from the edge of the screen.
  2. Then, in the Text component, change the Horizontal alignment to the left and change the Text to Score 0.
  3. Finally, change the Outline component's Effect Distance to 1.5, -1.5:
    Adding in Score/High score
  4. Next, we will want to duplicate the Score Text object and rename ...

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