Course contentsShow
← Unity Game Development
Lesson 9 of 8281. Unity FoundationsFree lesson

Defining Entities Through the GameObject Container

Learn to instantiate and manipulate empty GameObjects to serve as the fundamental building blocks for every scene element.

In this lesson, you will learn how to use the empty GameObject container as a fundamental "blank slate" to build any object in your game world.

What is a GameObject Container?

In Unity, a GameObject is essentially an empty "bucket" that exists in your scene. By itself, an empty GameObject doesn’t do much—it’s just a point in 3D space with a Transform component (which tracks its position, rotation, and scale). Think of it like a physical shipping crate: the crate itself is just a container, but what you put inside the crate determines what it actually is.

Building Your Entity

To turn an empty container into a functional entity, you add Components to it. When you create an empty GameObject (by right-clicking in the Hierarchy window and selecting Create Empty), you have a blank object ready to be defined.

  • If you add a Mesh Renderer and Mesh Filter component, your container becomes a visible object like a cube or sphere.
  • If you add a Light component, your container becomes a lamp or a sun.
  • If you add an Audio Source, your container becomes an invisible sound emitter.

You can even nest empty GameObject containers inside one another to organize your scene. For example, you might create an empty GameObject named "Player" and place the player's model, camera, and weapon objects as "children" underneath it. Now, when you move the "Player" container, everything inside it moves together as one cohesive unit.

Practical Application

You don't always need a pre-made model to start an entity. By creating an empty GameObject, you define the concept of an object before you ever give it a visual representation.

// Conceptually, you are creating an entity via the Hierarchy:
// 1. Create Empty (The Container)
// 2. Add Component -> Light (The Behavior)
// 3. Now you have a functional "Light Source" entity!

By mastering this, you stop thinking of game objects as just "models" and start thinking of them as flexible containers waiting for your custom logic.

Key Takeaway: An empty GameObject is a versatile, invisible container that gains its identity and functionality only when you attach components to it.