Skip to content
Tutorials Center
My learning

Topics

Lesson 11 of 38 ยท Actors and Components

Unreal Actors, Pawns, Characters and the Gameplay Framework

Learn what an Unreal actor is, how Pawn, Character, Controller, Game Mode and Player State fit together, and how actors are spawned, tagged, hidden and destroyed.

An actor is any object that can be placed or spawned in a level. A light is an actor; so are a wall, a door, a camera, a player and an invisible trigger. Understanding actors, and the small family of special actors that run the game, makes the rest of Unreal Engine much easier to read.

Unreal Engine cannot run on this page. The code and Blueprint terms below are explained in words, and the stand-ins model the class relationships in Python.

What an actor is

In C++ the class is AActor. An actor has:

  • a location, rotation and scale (its transform), through its root component;
  • a list of components that give it a look and behavior;
  • a lifecycle (created, begins play, ticks every frame, ends play, destroyed);
  • optional replication for multiplayer.

An actor by itself is just a container. Its look comes from components such as meshes, lights and audio.

The class family

flowchart TD
  A["Actor"] --> P["Pawn"]
  P --> C["Character"]
  A --> CT["Controller"]
  CT --> PC["PlayerController"]
  CT --> AI["AIController"]
  A --> GM["GameModeBase"]
  A --> PS["PlayerState"]
  A --> HUD["HUD"]

Pawns are controlled by Controllers; Game Mode sets the rules.

  • Pawn: an actor that can be possessed (controlled) by a player or AI. A simple pawn has no movement logic of its own.
  • Character: a Pawn with a capsule, a skeletal mesh and a Character Movement Component for walking, jumping, swimming and flying.
  • Controller: the "brain". A PlayerController turns input into commands; an AIController runs behavior logic. A controller can possess a different pawn at run time (for example when you enter a vehicle), and the controller keeps living when the pawn dies.
  • Game Mode: rules for a match. It picks the default pawn, controller, HUD and player state classes, and decides spawning and scoring. It exists only on the server.
  • Game State and Player State: replicated data about the match and about each player (score, name).
  • Game Instance: lives across level changes for the whole run; it holds persistent data.
Python Stand-in: the class hierarchy and an is-a check

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Placing and selecting actors

Drag from Place Actors or the Content Browser into the viewport, or right-click an empty area > Place Actor (older: Add Actor). Everything in the Outliner is an actor. Select one and the Details panel shows its transform and components.

Helpful actor properties in Details:

  • Mobility: Static (never moves, can use baked lighting), Stationary (lights that do not move) and Movable (can move at run time).
  • Actor Tags: text labels. A Blueprint can ask "which actors have the tag Enemy?"
  • Actor Hidden in Game and Hidden in the editor (eye icon).
  • Can be Damaged, Initial Life Span, Tick Interval, Replicates.
  • Folder: where it sits in the Outliner tree (editor only).

The actor lifecycle

  1. Constructed: the constructor or Construction Script runs; components are created.
  2. Begin Play: the level starts; run setup code here.
  3. Tick: each frame, if tick is enabled. Tick is costly, so turn it off for actors that do not need it.
  4. End Play: the actor is removed (destroyed, level unloaded, game ended).
  5. Destroyed: memory is freed after garbage collection.

You create actors at run time with Spawn Actor from Class (Blueprint) or GetWorld()->SpawnActor (C++), and you remove them with Destroy Actor or Destroy(). The next lessons cover Blueprints and C++ in depth.

Python Stand-in: an actor lifecycle with tick

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Finding actors

Common ways to get a reference to another actor:

  • Get All Actors Of Class (searches the whole world; avoid it in tick).
  • Get All Actors With Tag.
  • Get Player Pawn / Get Player Character / Get Player Controller (index 0 is the first local player).
  • A public variable set in the level: in the Details panel pick an actor from a drop-down. This is the cleanest option.
  • An overlap, hit or line trace event gives you the actor you touched.

Name actors clearly in the Outliner (F2) and group them in folders. A level with 400 actors called StaticMeshActor_287 is hard to maintain.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which class gives a pawn walking, jumping and a capsule out of the box?

    Character extends Pawn with a capsule, a mesh and the Character Movement Component.
  2. 2. What is the job of a PlayerController?

    Controllers possess pawns and drive them; the controller outlives the pawn.
  3. 3. Which object survives a level change and holds persistent data?

    The Game Instance exists for the whole run of the game.
  4. 4. Why disable tick on actors that do not need it?

    Per-frame work adds up; actors that react only to events should not tick.

Summary

  • An actor is any placeable or spawnable object; its look and behavior come from components.
  • Pawns are possessed by Controllers; Characters are Pawns with built-in movement; Game Mode sets the rules.
  • Actors have a lifecycle: construct, begin play, tick, end play, destroy.
  • Use tags, variables and traces to find actors; avoid scanning the whole world each frame.

Next: Components and the Scene Hierarchy