Actors, Components, and Levels
# CHAPTER 3
Actors, Components, and Levels
1. Introduction
To build a game in Unreal Engine, you must understand its fundamental DNA. Unreal Engine uses a strict, logical architecture based on three main concepts: Levels, Actors, and Components. If you understand how these three pieces fit together, you can build anything from a simple bouncing ball to a complex driving simulator. In this chapter, we will dissect the Actor-Component architecture. We will learn that nothing exists in a game world unless it is an Actor, and an Actor can do absolutely nothing unless it is given Components.2. Learning Objectives
By the end of this chapter, you will be able to:- Define a "Level" (or Map) in UE5.
- Define an "Actor" and explain its role as the base object of UE5.
- Define "Components" and understand how they grant abilities to Actors.
- Understand Parent-Child relationships in the Scene Hierarchy.
- Manipulate the Transform (Location, Rotation, Scale) data.
3. The Hierarchy of the Unreal World
Think of Unreal Engine like a theater production.- 1. The Level: This is the physical theater stage. It holds everything.
- 2. The Actors: These are the performers, props, and lights on the stage.
- 3. The Components: These are the skills and costumes given to the actors. (e.g., A "Voice Component" allows an actor to speak; a "Costume Component" determines what they look like).
4. What is a Level?
A Level (often saved as a.umap file) is a container. Everything the player experiences happens inside a Level. A main menu is a level. The first mission is a level. A game is simply the process of loading one Level, playing it, and then loading the next Level.
5. What is an Actor?
An Actor is any object that can be placed into a Level.- A 3D model of a tree is an Actor.
- A lightbulb is an Actor.
- The player character is an Actor.
- An invisible trigger box that opens a door is an Actor.
6. What is a Component?
An Actor by itself is essentially an invisible, empty point in space. It has no physical form and does nothing. Components are modular pieces of functionality that you attach to an Actor.- Static Mesh Component: Gives the Actor a 3D visual shape (like a rock or a car body).
- Audio Component: Allows the Actor to play a sound (like a humming engine).
- Point Light Component: Causes the Actor to emit light.
- Box Collision Component: Gives the Actor physical boundaries so the player can't walk through it.
*Example:* A "Campfire" Actor is just an empty container. You add a *Static Mesh Component* (logs of wood), a *Particle System Component* (the fire visual), an *Audio Component* (crackling sound), and a *Point Light Component* (orange glow). Combined, they create the Campfire Actor.
7. The Transform System
Every Actor (and most Components) has a Transform. The Transform contains three pieces of mathematical data:- Location (X, Y, Z): Where is it in the world?
- Rotation (Roll, Pitch, Yaw): What direction is it facing?
- Scale (X, Y, Z): How big is it?
8. Visual Learning: Actor-Component Architecture
9. Best Practices
- Use the Component Philosophy: Do not create a single, massive C++ script or Blueprint to handle everything an Actor does. Break functionality into modular Components. If you write a "Health Component," you can attach it to the Player Actor, the Enemy Actor, and a Destructible Barrel Actor, reusing the exact same logic.
10. Common Mistakes
- Scaling the Root Component: When an Actor has multiple components (e.g., a car body and four wheels), one component acts as the "Root" (the parent). If you scale the Root Component, all the child components scale with it. Beginners often accidentally scale the parent, distorting the entire object, instead of scaling the specific child component.
11. Mini Project: Build a Custom Lamp Actor
Objective: Combine components to create a functional object.-
1.
Open your project. In the Content Browser, right-click and select Blueprint Class. Choose Actor as the parent class. Name it
BPMyLamp.
-
2.
Double-click
BPMyLampto open the Blueprint Editor.
- 3. Look at the top-left Components Panel. It only has a "DefaultSceneRoot".
- 4. Click the green + Add button. Search for and add a Static Mesh.
-
5.
With the Static Mesh selected, look at the Details panel on the right. Under "Static Mesh", select
SMLampWall(from Starter Content).
- 6. Click + Add again. Search for and add a Point Light.
-
7.
Use the
Wkey (Move tool) inside the Blueprint viewport to drag the Point Light so it sits exactly where the bulb is on the mesh.
- 8. Click Compile and Save (top left).
-
9.
Drag
BP_MyLampfrom the Content Browser into your main Level. You just built a custom Actor!
12. Practice Exercises
- 1. In the UE5 Viewport, which color arrow corresponds to the X, Y, and Z axes respectively? (Hint: Think RGB).
- 2. Explain why a 3D model of a rock is considered an Actor, but the visual mesh of the rock itself is a Component.
13. MCQs with Answers
What is the modular building block that you attach to an Actor to give it specific functionality, such as a physical shape, a sound, or a light?
Which data set determines an Actor's exact position, rotation, and size in the 3D world?
14. Interview Questions
- Q: Explain the Unreal Engine architecture using the terms Level, Actor, and Component. How do they relate to each other?
- Q: What is the concept of a "Root Component" in an Actor? How does changing the Transform of a Root Component affect its child components?
15. FAQs
Q: Is a Player an Actor? A: Yes! A player character is a highly specialized type of Actor (specifically, aCharacter or Pawn class) that has extra components built-in, like a CharacterMovementComponent to handle walking and jumping.