Module 5 Challenge

Tutorial

·

intermediate

·

+0XP

·

30 mins

·

(29)

Unity Technologies

Module 5 Challenge

This module covers the creation and management of in-game UI elements. Learners will design a score display, update UI values dynamically, and implement functionality to toggle menus during gameplay using Unity’s UI components and scripting techniques.

By the end of this module, learners will be able to:

  • Design and implement a score UI using Text Mesh Pro.
  • Update UI values dynamically based on gameplay events.
  • Use the singleton pattern to manage UI elements effectively.
  • Toggle menus during gameplay using Unity scripting.

1. Challenge

Challenge

Estimated Time: 30 minutes

In this challenge, reposition the UI elements to fit your liking.

Challenge Steps

  1. Change the anchor position of the gameplay UI’s label and Score Rect Transform components to one of the other corners of the screen.
  2. You will need to update the X and Y positions depending on where you anchor the canvas; experiment with positive and negative values to position it in a way that suits you.
  3. If you choose to position the elements in the right corner, consider if it would be better to reverse the position of the counter and the label.

2. Bonus Challenge

Bonus Challenge

  1. Change the TMP Font asset in the label and counter TMP_Text components in the gameplay UI.
  2. Additional fonts are included in the project; the browse button beside the font asset will allow you to select them.
  3. You can create a new Text Mesh Pro compatible font by importing a TTF file, right-clicking on it, and using the Create > TextMeshPro > Font Asset menu.

Complete this tutorial