Use labels to annotate GameObjects in Unity

So far, you’ve assembled the game with GameObjects that you want the player to see. When it comes to spawn points, you don’t want anybody to see them. Yet, it’s important that you know where they lay.

You could create a 3D cube and place it in your scene to represent a spawn point, then remove it when the game starts, but that’s a clunky approach.

Unity provides a simpler mechanism called labels, which are GameObjects visible in the Scene view, but invisible during gameplay. To see them in action, you’ll create a bunch of different spawn points, similar to how you created the columns.

Note: This tutorial is part of a collection that teaches Unity development from the ground up. You can read the entire series over here. This series is free and does not require any account creation. All assets are provided. If you find it useful, feel free to buy me a coffee.

Creating a spawn point

Click the Create button in the Hierarchy and select Create Empty. Give it the name Spawn and set position to (-5.44, 13.69, 90.30).

In the Inspector, click the colored cube next to the checkmark. A flyout with all the different label styles will appear. Click blue capsule.

Look at your Scene view; you’ll see it’s been annotated with the spawn point. It is looking a little small.

You may not see the label in your Scene. First, your gizmos may be disabled. Look at the top of the Scene view and you’ll see gizmos button on the far right.

The button should be light blue. Light blue indicates that the feature is enabled. If you see it white, then the feature is disabled. In that case, simply press the button once. It should turn blue and your gizmos will appear.

Next, click the dropdown arrow. Drag the 3D icons slider to the far right. This will increase the size of the labels so you can see them when zoomed out.

While that may work, the player will most certainly spawn camp. A better solution is multiple spawn points.

Creating multiple spawn points.

You need to create 11 more spawn points. That sounds like a lot. You need to duplicate a spawn point and place it in the arena. The spawn points should be placed evenly around the arena. Thankfully, you can “eyeball” it.

Make placement easier by doing the following:

  • In the Scene view, click on the center cube of the scene gizmo to switch the Scene view to Isometric mode.
  • Click the green y-axis arrow so that you look down on the scene.

Now proceed with duplicating and repositioning 11 more spawn points.

Don’t worry if you don’t get them exactly the same – game design is more of an art than a science!

Once you’re done, click the Create button in the Hierarchy, select Create Empty and name it SpawnPoints. Drag all the spawn points into it. Batch rename them like you did with the columns to Spawn.

Congratulations! Your game is now properly set up. Make sure to save!

Where to go from here

This completes chapter two. Well done! You can download the completed sample project for this chapter here:

https://drive.google.com/file/d/1biAfMobYGPt7zXlGiW7IpLYIJff0uaAl/view?usp=drive_link

At this point, you have your hero, a killer alien and the arena in which they will battle to the death. You’ve even created spawn points for the little buggers. As you set things up, you learned about:

  • GameObjects and why they are so important when working with Unity.
  • Prefabs for when you want to create many instances of a single GameObject.
  • Labels to help you annotate game development without interfering with the game.

There’s still no action in your game, but that’s fine. You’re ready to learn how to give your game the breath of life and take it away (via the space marine’s magnificent machine gun). You’ll get started by learning about components in the next tutorial.


Discover more from Jezner Books

Subscribe to get the latest posts sent to your email.

By Brian Moakley

Brian Moakley is a writer and editor who lives amongst the quiet hills in New England. When not reading tales of high adventure, he is often telling such stories to all who will listen.

Related Post

Leave a Reply