Basic Unity UI Setup

How to set up a simple UI in a Unity project

Daniele Quero, PhD
Nerd For Tech

--

Objective: Learn the basics of UI editing in Unity

With this tutorial, I want to show how easy can be to build a simple UI in Unity. Many tools and objects can be used.

The idea is to create a simple UI setting showing some text on screen, namely the score that will update after each enemy kill and sprites showing how many lives are left.

There are very few steps but we’ll have the chance to learn a lot about some core concepts. Let’s start creating!

With a simple right-click on the hierarchy view, Unity offers the possibility of creating several UI objects, we’ll choose text.

Text — Score

When a UI object is selected, automatically Unity will put on the scene an EventSystem gameobject that will be explored for interaction with UI, and a Canvas object with a child: the selected UI object, text in this case. Let’s rename it to Score.

Canvas is almost literally the canvas on which we’re going to paint our UI. On the scene view, it will appear like a huge rectangle.

--

--

Daniele Quero, PhD
Nerd For Tech

A professional developer with passion for game developing and skill-growing. A former Nuclear Physics Researcher who changed his life to pursue his dreams