class

AActor

Module
Game
Header
#include "Game/AActor.h"
Namespace
Mowo
Reflection
Reflected by MowoHeaderTool

Properties

TypeNameDescription
ETickGroupprimaryTickGroupDefault is PrePhysics — flip in subclass ctor when ordering matters. Default ETickGroup::PrePhysics.
boolcanEverTickUE's bCanEverTick: actors that opt out never enter the tick schedule at all — the dominant case for placed scenery. Defaults ON for compatibility; subclasses (and the Visual Script bind, which knows whether any Tick graph or latent node exists in the chain) flip it off. Default true.
booltickOnAnyThreadUE's bRunOnAnyThread: the world may run this actor's tick (its tickInterval pacing, the virtual Tick and the components it ticks) on a task-graph worker, in parallel with the group's other such actors once their prerequisites have ticked. Off by default, and only for an actor whose tick touches nothing but its own state — no spawning or destroying, no structural ECS work, no Visual Scripting, no other actor's fields. Components with a tickGroupOverride still tick on the game thread. Default false.
floatCustomTimeDilationPer-actor multiplier on top of the world's time dilation, so a single actor can run in slow motion (or keep full speed while the rest of the world is slowed) without a second clock. The world reads it when it computes this actor's tick delta; 1 = follow the world exactly, 0 = frozen. Default 1.0f.
floattickIntervalTick pacing (UE TickInterval): 0 = every frame. When set, the world accumulates this actor's dilated time and Tick fires once the interval elapses, receiving the ACCUMULATED delta — dt-integrating gameplay stays exact, it just steps coarser. The cost lever for things that don't need per-frame updates (distant AI, ambience). Default 0.0f.

Constructors

SignatureNameDescription
AActor() = defaultAActor
~AActor() override = default~AActor

Public functions

ReturnsNameDescription
voidOnConstructConstruction event (UE Construction Script analog).
MClass*GetClass
voidSetClassOverride
voidRegisterComponentsPublish this actor onto its backing ECS entity.
voidBeginPlayCalled once when the world begins play, or at registration for an actor spawned into a world that already has.
boolHasActorBegunPlayTrue between the world's BeginPlay and EndPlay.
voidDispatchTickNon-virtual dispatch the world calls: applies tickInterval pacing BEFORE the virtual Tick, so subclass overrides pace with it.
voidTickOverrideComponentsWorld-driven pass for components whose tickGroupOverride names this group: they tick AFTER every actor of the group, regardless of the owner's own group.
voidTickPer-frame tick.
boolShouldTickInEditorEditor-time actors (UE's ShouldTickIfViewportsOnly).
voidTickInEditor
boolIsEditorWorldTrue while this actor's world is the level being authored.
boolIsTransientGenerated content: an actor (or component) an editor-time actor created for preview is transient.
voidSetTransient
AActor*GetGeneratedOwner
voidSetGeneratedOwner
voidMarkGeneratedMakes generated this actor's transient output: transient, owned by this actor, so it is cleaned up with it.
voidClearGeneratedContentDestroys every actor this one generated and drops its transient components; call it before regenerating and from EndPlay.
EEndPlayReasonGetEndPlayReason
voidDestroyedFired by MWorld::Destroy right before EndPlay — the explicit- destruction hook (UE Destroyed()).
voidEndPlayCalled when the actor is removed from the world.
Vec3GetLocationTransform Root transform — typically the root MSceneComponent's transform.
QuatGetRotation
Vec3GetScale
voidSetLocation
voidSetRotation
voidSetScale
boolGetSocketTransformSockets — the named attachment points a mesh carries (a muzzle, a hand bone, a roof mount).
boolHasSocket
Vec3GetSocketLocation
Vec3GetActorLocation
voidSetActorLocation
boolCanMoveAtRuntimeFalse for a Static or Stationary actor once its world has begun play (UE's mobility rule); the refused move logs a warning naming the actor.
std::stringGetActorName
voidSetActorHiddenInGame
voidAddComponentComponent management Attach a component.
boolRemoveComponentDetach a component added at run time (a script component a designer removed): it leaves the list and loses its owner; the caller ends its play and lets it be collected.
T*CreateDefaultSubobjectConvenience for subclass constructors.
voidInitDefaultSubobjectConfigThe INI's MPROPERTY(Config) values from the component class's default object: a constructor-made component is never cloned from a default, so this is the only way a project's Game.ini reaches it.
T*FindComponentFind first component of the given type.
const std::vector<MActorComponent*>&GetComponentsRead-only access to the full component list (for iteration).
MActorComponent*GetComponentByClassThe reflected component lookups: by class name (the component's own class or any ancestor, so "MSceneComponent" finds a mesh component) and by the name it was created under.
MActorComponent*GetComponentByName
int32_tGetComponentCount
MSceneComponent*GetRootComponentThe scene root — the component whose transform is the actor's transform.
voidSetRootComponent
MWorld*GetWorldWorld
voidSetWorldOut-of-line: the TObjectPtr store barrier needs the complete type, and MWorld is only forward-declared here.
EntityIDGetBackingEntityECS bridge Backing entity in the scene's ECS World.
voidSetBackingEntity
voidPullFromBackingEntityAdoption counterpart to the OnRegister push: seed the root transform from the entity's TransformComponent and fan PullFromMirror out to every component, so re-publishing the mirror reproduces the scene's authored values instead of class defaults.
voidAddTagGameplay tags Hierarchical identifiers (Damage.Physical, Faction.Enemy.Goblin) used for AI behaviour predicates, ability requirements, gameplay filters.
voidRemoveTag
boolHasTag
boolHasTagExact
boolHasAnyTag
const std::vector<std::string>&GetTags
const std::string&GetArchetypeNameThe template (archetype) this instance derives its defaults from, or empty when it derives straight from the class CDO.
voidSetArchetypeName
voidAddTickPrerequisiteTick prerequisites This actor's Tick runs only after every prerequisite in the SAME tick group has ticked this frame; prerequisites in other groups are already ordered by the group sequence.
voidRemoveTickPrerequisite
const std::vector<TWeakObjectPtr<AActor>>&GetTickPrerequisites

Function details

AActor

C++
AActor() = default

~AActor

C++
~AActor() override = default

OnConstruct

C++
virtual void OnConstruct()

Construction event (UE Construction Script analog). Runs after the backing entity exists and before BeginPlay; the editor re-runs it when instance properties change, so keep it idempotent — derive state, don't accumulate it. Default: no-op.

GetClass

C++
MClass* GetClass() const override

SetClassOverride

C++
void SetClassOverride(MClass* cls)

RegisterComponents

C++
virtual void RegisterComponents()

Publish this actor onto its backing ECS entity. Runs at registration — scene load included — so a placed actor draws and inspects in the editor without beginning play. Default impl dispatches OnRegister to every component; overrides must call Super::RegisterComponents().

BeginPlay

C++
virtual void BeginPlay()

Called once when the world begins play, or at registration for an actor spawned into a world that already has. Default impl dispatches BeginPlay to every component — overrides must call Super::BeginPlay(). Gameplay startup only: the ECS mirror is already published by RegisterComponents.

HasActorBegunPlay

C++
bool HasActorBegunPlay() const noexcept

True between the world's BeginPlay and EndPlay. MWorld owns the flag, which is what makes double-BeginPlay across a PIE Play/Stop/Play cycle impossible.

DispatchTick

C++
void DispatchTick(float deltaSeconds)

Non-virtual dispatch the world calls: applies tickInterval pacing BEFORE the virtual Tick, so subclass overrides pace with it.

TickOverrideComponents

C++
void TickOverrideComponents(ETickGroup group, float deltaSeconds)

World-driven pass for components whose tickGroupOverride names this group: they tick AFTER every actor of the group, regardless of the owner's own group. Inherit components (-1) tick inside Tick as ever.

Tick

C++
virtual void Tick(float deltaSeconds)

Per-frame tick. Default: dispatch to every component's TickComponent. Override on actors that need pre/post-component logic; call Super::Tick(dt) to keep components ticking.

ShouldTickInEditor

C++
virtual bool ShouldTickInEditor() const

Editor-time actors (UE's ShouldTickIfViewportsOnly). Off by default: a placed actor is inert in the editor until Play. An actor that previews generated content in edit mode (a procedural world, a spline mesh) returns true and does its work in TickInEditor, which the edit world calls once a frame within the ed.TickBudgetMs budget. Never called in a PIE copy or a game, and not while a Play session replaces the edit world, so the work stops at Play and resumes at Stop. Tick and BeginPlay stay play-only: the default TickInEditor does nothing, it does not forward to Tick.

TickInEditor

C++
virtual void TickInEditor(float deltaSeconds)

IsEditorWorld

C++
bool IsEditorWorld() const

True while this actor's world is the level being authored. Constructors, OnConstruct and RegisterComponents run in the editor as well as in games, so gameplay-only startup asks this.

IsTransient

C++
bool IsTransient() const noexcept

Generated content: an actor (or component) an editor-time actor created for preview is transient. A transient actor is not written to the level, not copied into the Play world (which regenerates its own from BeginPlay), is hidden from the Outliner unless "Show Generated" is on, and selecting it selects its generating owner. Setting transient does not touch the scene's dirty state or the undo stack.

SetTransient

C++
void SetTransient(bool transient) noexcept

GetGeneratedOwner

C++
AActor* GetGeneratedOwner() const

SetGeneratedOwner

C++
void SetGeneratedOwner(AActor* owner)

MarkGenerated

C++
void MarkGenerated(AActor* generated)

Makes generated this actor's transient output: transient, owned by this actor, so it is cleaned up with it.

ClearGeneratedContent

C++
void ClearGeneratedContent()

Destroys every actor this one generated and drops its transient components; call it before regenerating and from EndPlay. Does nothing for content that is not transient.

GetEndPlayReason

C++
EEndPlayReason GetEndPlayReason() const

Destroyed

C++
virtual void Destroyed()

Fired by MWorld::Destroy right before EndPlay — the explicit- destruction hook (UE Destroyed()). NOT called on world teardown, play end or ejection; use EndPlay + GetEndPlayReason for those.

EndPlay

C++
virtual void EndPlay()

Called when the actor is removed from the world. Counterpart to BeginPlay — default impl dispatches EndPlay to components in reverse order. Overrides must call Super::EndPlay().

GetLocation

C++
Vec3 GetLocation() const

Transform Root transform — typically the root MSceneComponent's transform. Convenience accessors mirror to the root component.

GetRotation

C++
Quat GetRotation() const

GetScale

C++
Vec3 GetScale() const

SetLocation

C++
void SetLocation(const Vec3& v)

SetRotation

C++
void SetRotation(const Quat& q)

SetScale

C++
void SetScale(const Vec3& v)

GetSocketTransform

C++
bool GetSocketTransform(const std::string& socketName, Vec3& outLocation, Quat& outRotation) const

Sockets — the named attachment points a mesh carries (a muzzle, a hand bone, a roof mount). Asks every scene component on the actor, in attachment order, and returns the first that owns the name; the transform comes back in WORLD space, composed onto the owning component, which is what a caller placing an effect or spawning a projectile actually needs. False leaves the outputs untouched.

HasSocket

C++
bool HasSocket(const std::string& socketName) const

GetSocketLocation

C++
Vec3 GetSocketLocation(const std::string& socketName) const

GetActorLocation

C++
Vec3 GetActorLocation() const

SetActorLocation

C++
void SetActorLocation(const Vec3& location)

CanMoveAtRuntime

C++
bool CanMoveAtRuntime() const

False for a Static or Stationary actor once its world has begun play (UE's mobility rule); the refused move logs a warning naming the actor.

GetActorName

C++
std::string GetActorName() const

SetActorHiddenInGame

C++
void SetActorHiddenInGame(bool hidden)

AddComponent

C++
void AddComponent(MActorComponent* component)

Component management Attach a component. Takes ownership of the raw pointer; the actor will destroy it on EndPlay. Use the templated CreateDefaultSubobject<T>() helper in subclass constructors.

RemoveComponent

C++
bool RemoveComponent(MActorComponent* component)

Detach a component added at run time (a script component a designer removed): it leaves the list and loses its owner; the caller ends its play and lets it be collected. False when it was not this actor's.

CreateDefaultSubobject

C++
template<typename T> T* CreateDefaultSubobject(const char* name)

Convenience for subclass constructors. Constructs a T, sets its name, attaches to this actor, returns the raw pointer. class APhysicsBox : public AActor { APhysicsBox() { auto* root = CreateDefaultSubobject<MSceneComponent>("Root"); SetRootComponent(root); auto* mesh = CreateDefaultSubobject<MStaticMeshComponent>("Mesh"); mesh->AttachTo(root);

InitDefaultSubobjectConfig

C++
static void InitDefaultSubobjectConfig(MActorComponent* component)

The INI's MPROPERTY(Config) values from the component class's default object: a constructor-made component is never cloned from a default, so this is the only way a project's Game.ini reaches it.

FindComponent

C++
template<typename T> T* FindComponent() const

Find first component of the given type. Returns nullptr if not attached. O(N) in component count — fine for typical actors with <10 components.

GetComponents

C++
const std::vector<MActorComponent*>& GetComponents() const

Read-only access to the full component list (for iteration).

GetComponentByClass

C++
MActorComponent* GetComponentByClass(const std::string& className) const

The reflected component lookups: by class name (the component's own class or any ancestor, so "MSceneComponent" finds a mesh component) and by the name it was created under. Nothing when absent.

GetComponentByName

C++
MActorComponent* GetComponentByName(const std::string& name) const

GetComponentCount

C++
int32_t GetComponentCount() const

GetRootComponent

C++
MSceneComponent* GetRootComponent() const

The scene root — the component whose transform is the actor's transform. Always an MSceneComponent. nullptr for actors that are pure logic (controllers / managers).

SetRootComponent

C++
void SetRootComponent(MSceneComponent* root)

GetWorld

C++
MWorld* GetWorld() const

World

SetWorld

C++
void SetWorld(MWorld* world)

Out-of-line: the TObjectPtr store barrier needs the complete type, and MWorld is only forward-declared here.

GetBackingEntity

C++
EntityID GetBackingEntity() const

ECS bridge Backing entity in the scene's ECS World. Created by MWorld::RegisterActor when the world has an ECS world attached; INVALID_ENTITY otherwise (pure-logic worlds, tests). Components mirror render/physics state onto it so the flat systems (SceneRenderer's MeshRenderer iteration, TransformSystem) see actors without knowing about the OO layer. MWorld::Tick syncs the root component transform into the entity each frame.

SetBackingEntity

C++
void SetBackingEntity(EntityID id)

PullFromBackingEntity

C++
void PullFromBackingEntity(World* ecs)

Adoption counterpart to the OnRegister push: seed the root transform from the entity's TransformComponent and fan PullFromMirror out to every component, so re-publishing the mirror reproduces the scene's authored values instead of class defaults.

AddTag

C++
void AddTag(FGameplayTag tag)

Gameplay tags Hierarchical identifiers (Damage.Physical, Faction.Enemy.Goblin) used for AI behaviour predicates, ability requirements, gameplay filters. HasTag uses hierarchical matching — a query for "Damage" matches an actor tagged "Damage.Physical.Slash". Storage is a vector of canonical dot-paths rather than a TSet<FGameplayTag>, which is what makes the field reflectable and therefore serialized: MHT maps std::vector<T> to PropertyType::Array and has no set support at all, and FGameplayTag itself is not a reflected struct (its only member is an FName, which is not a PropertyType either). A vector of strings needs nothing new from the header tool, round-trips through the existing scene writer and shows up in the inspector. Uniqueness is enforced in AddTag; actors carry a handful of tags, so the linear scan is not worth a set.

RemoveTag

C++
void RemoveTag(FGameplayTag tag)

HasTag

C++
bool HasTag(FGameplayTag tag) const

HasTagExact

C++
bool HasTagExact(FGameplayTag tag) const

HasAnyTag

C++
bool HasAnyTag(const TSet<FGameplayTag>& s) const

GetTags

C++
const std::vector<std::string>& GetTags() const noexcept

GetArchetypeName

C++
const std::string& GetArchetypeName() const noexcept

The template (archetype) this instance derives its defaults from, or empty when it derives straight from the class CDO. When set, the scene writer diffs the instance against the named template instead of the CDO (instance -> template -> CDO -> class), so raising a template default reaches every instance of it that never overrode the field.

SetArchetypeName

C++
void SetArchetypeName(const std::string& name)

AddTickPrerequisite

C++
void AddTickPrerequisite(AActor* prerequisite)

Tick prerequisites This actor's Tick runs only after every prerequisite in the SAME tick group has ticked this frame; prerequisites in other groups are already ordered by the group sequence. Cycles degrade to registration order. Dead prerequisites are ignored and pruned.

RemoveTickPrerequisite

C++
void RemoveTickPrerequisite(AActor* prerequisite)

GetTickPrerequisites

C++
const std::vector<TWeakObjectPtr<AActor>>& GetTickPrerequisites() const noexcept
Generated from Game/AActor.h via game.json · Nov 5, 2026Version 1.0.0