Actor

Introduction Actor is one of the most important aspects of Unreal Engine, it lays at the core of everything you will do interacting in the Unreal Editor viewport and the Game World. This core Unrea...

Updated about 5 years ago

Introduction

Actor is one of the most important aspects of Unreal Engine, it lays at the core of everything you will do interacting in the Unreal Editor viewport and the Game World. This core Unreal Engine Class AActor forms the basis for any Object you can see in the viewport in the 3d space, this does not include UMG widgets which are overlays.

Components

Actors are made up of various Components.

Info

There are a class of Actors which have very minimal presence in the game world, they are largely managers and extend from the Info Actor. See Game Framework explained for more.

Spawn

Spawning refers to the process of creating an Actor, similar to New Object though having a physical presence in the game world means Actors are treated differently, because they have components like collision. If an Actors Spawn location is being blocked we call that Enroachment, its when two Actors (or more) share the same physical space.

GetWorld()->SpawnActor();

Since there is a requirement to having a game world we must first GetWorld to call Spawn on, this function is inherited by all Actors. This is the most basic implementation calling the default constructor.

    FActorSpawnParameters SpawnInfo;
    SpawnInfo.Owner = this;
    SpawnInfo.Instigator = GetInstigator();
    SpawnInfo.ObjectFlags |= RF_Transient;
    YourActorReference = GetWorld()->SpawnActor(SpawnInfo);

Spawning has the associated structure FActorSpawnParameters which is used to pass in a number of parameters to the Spawn function as in this example.

GetWorld()->SpawnActor(YourActorClass, SpawnInfo);

The above lets you specify a class with YourActorClass you may wish this to be editable on children of this class.

See Spawning Actors in C++

See Spawning and Destroying Actors in Blueprint

Destroy

Archetypes

Replication

Actor Channels

Further Reading

Actors Architecture

AActor

Using Actors in Unreal Editor

Actor References in Blueprint

Actor

This helps keep the lights on