What is an Actor?

An Actor is any object that can be placed or spawned in a level. Actors support 3D transformations (location, rotation, scale) and can contain an arbitrary collection of Components that define their behavior and appearance. AActor is the base C++ class for all actors.

Actors do not have a transform by themselves — they get their transform from a special Root Component. The root component establishes the origin point for the Actor in world space.

Diagram showing Actor as root with multiple components attached
An Actor contains a hierarchy of Components. The root component (typically a Scene Component) defines the actor's world transform.

Actor Lifecycle

Every Actor goes through a well-defined lifecycle:

  1. SpawnActor — The world spawns the actor (allocates memory, calls constructor).
  2. BeginPlay — Called once when the game starts or the actor is spawned mid-game.
  3. Tick — Called every frame (if PrimaryActorTick.bCanEverTick = true).
  4. EndPlay — Called when the actor is destroyed or the level ends.
  5. Destroy — Memory is freed.

Components

Components are modular pieces of functionality attached to an Actor. They can represent geometry, collision, audio, physics, camera, and much more. UE5 includes dozens of built-in component types, and you can create custom components in C++ or Blueprint.

ComponentClassPurpose
Scene ComponentUSceneComponentHas a transform. Root of any component hierarchy.
Static MeshUStaticMeshComponentRenders a static 3D mesh.
Skeletal MeshUSkeletalMeshComponentAnimated mesh driven by a skeleton.
Box CollisionUBoxComponentBox-shaped collision volume.
Sphere CollisionUSphereComponentSphere-shaped collision volume.
CameraUCameraComponentDefines a camera view.
Point LightUPointLightComponentOmni-directional light source.
AudioUAudioComponentPlays a sound in 3D space.
Particle SystemUNiagaraComponentNiagara VFX particle emitter.
Character MovementUCharacterMovementComponentProvides walking, jumping, swimming, flying.

Creating an Actor in C++

The following example creates a custom Actor with a Static Mesh component and a Box Collision component. The actor pulses its material scalar parameter over time.

C++ — Header
// MyPulsingActor.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "MyPulsingActor.generated.h"

UCLASS()
class MYGAME_API AMyPulsingActor : public AActor
{
    GENERATED_BODY()

public:
    AMyPulsingActor();

protected:
    virtual void BeginPlay() override;
    virtual void Tick(float DeltaTime) override;

    UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
    UStaticMeshComponent* MeshComp;

    UPROPERTY(VisibleAnywhere)
    UBoxComponent* TriggerBox;

    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Pulse")
    float PulseSpeed = 2.0f;

private:
    UMaterialInstanceDynamic* DynMat;
    float ElapsedTime = 0.f;
};
C++ — Implementation
// MyPulsingActor.cpp
#include "MyPulsingActor.h"
#include "Components/BoxComponent.h"
#include "Components/StaticMeshComponent.h"
#include "Materials/MaterialInstanceDynamic.h"

AMyPulsingActor::AMyPulsingActor()
{
    PrimaryActorTick.bCanEverTick = true;

    // Root collision box
    TriggerBox = CreateDefaultSubobject<UBoxComponent>(TEXT("TriggerBox"));
    SetRootComponent(TriggerBox);
    TriggerBox->SetBoxExtent(FVector(50.f));

    // Visible mesh attached to root
    MeshComp = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh"));
    MeshComp->SetupAttachment(TriggerBox);
}

void AMyPulsingActor::BeginPlay()
{
    Super::BeginPlay();
    // Create a dynamic material instance so we can change parameters at runtime
    DynMat = MeshComp->CreateAndSetMaterialInstanceDynamic(0);
}

void AMyPulsingActor::Tick(float DeltaTime)
{
    Super::Tick(DeltaTime);
    ElapsedTime += DeltaTime;
    if (DynMat)
    {
        const float PulseValue = (FMath::Sin(ElapsedTime * PulseSpeed) + 1.f) * 0.5f;
        DynMat->SetScalarParameterValue(TEXT("EmissiveIntensity"), PulseValue * 5.f);
    }
}

Blueprint Actor Example

The same pulsing actor can be created entirely in Blueprint using the Construction Script for setup and the Event Graph for runtime logic:

Blueprint Event Graph showing Event Tick driving a material parameter
Blueprint Event Graph: Event Tick → Time + Sin → Lerp → Set Material Scalar Parameter. No C++ required.

Spawning Actors at Runtime

Actors are spawned at runtime via the world's SpawnActor templated function. You specify the class, transform, and optional spawn parameters:

C++
// Spawn a projectile at the muzzle socket
FActorSpawnParameters SpawnParams;
SpawnParams.Owner = this;
SpawnParams.Instigator = GetInstigator();
SpawnParams.SpawnCollisionHandlingOverride =
    ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn;

FVector  SpawnLoc = GetActorLocation() + GetActorForwardVector() * 100.f;
FRotator SpawnRot = GetActorRotation();

AMyProjectile* Projectile = GetWorld()->SpawnActor<AMyProjectile>(
    ProjectileClass, SpawnLoc, SpawnRot, SpawnParams);
⚠️
Null Check

Always check that SpawnActor did not return nullptr before using the result. Spawn may fail if the location overlaps with blocking geometry and no adjustment is possible.