class

MActorComponent

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

Properties

TypeNameDescription
booltickEnabledTick gate — set to false to skip TickComponent without disabling the component. Cheaper than detaching/reattaching for things that only sometimes need ticking (e.g. an AI component that's only active while the player is nearby). Default true.
floattickIntervalTick pacing (UE TickInterval): 0 = every frame. When set, the owning actor accumulates time and TickComponent fires with the ACCUMULATED delta once the interval elapses. Default 0.0f.
int32_ttickGroupOverridePer-component tick group override. -1 (default) = tick inside the owner's Tick, in the owner's group. 0..3 = AActor::ETickGroup values (PrePhysics/DuringPhysics/PostPhysics/PostUpdateWork): the world then ticks this component in THAT group's pass instead — after every actor of the group has ticked. An int rather than the enum so this header keeps its forward-declared AActor. Default -1.

Constructors

SignatureNameDescription
MActorComponent() = defaultMActorComponent
~MActorComponent() override = default~MActorComponent

Public functions

ReturnsNameDescription
voidOnRegisterLifecycle — AActor dispatches.
voidBeginPlay
voidTickComponent
voidEndPlay
voidPullFromMirrorInverse of the OnRegister push, run when an actor adopts an entity the scene loader already populated: read exactly the mirrored fields the push writes, before serialized actor deltas apply.
voidRefreshMirrorRe-publish the fields a component mirrors onto the ECS (its light, mesh, audio, ...).
AActor*GetOwnerOwning actor — set by AActor::AddComponent when the component is attached.
voidSetOwnerOut-of-line: the TObjectPtr store barrier needs the complete type, and AActor is only forward-declared here.
boolIsTransientCreated by an editor-time actor for preview: AActor::ClearGeneratedContent removes it.
voidSetTransient
boolIsInstanceComponentTrue for a component a designer added to this placed actor in the editor (FInstanceComponents), as opposed to one the class constructor creates.
voidSetInstanceComponent
boolAdvanceTickAccumulatorCalled by the owning actor's Tick: applies tickInterval pacing.

Function details

MActorComponent

C++
MActorComponent() = default

~MActorComponent

C++
~MActorComponent() override = default

OnRegister

C++
virtual void OnRegister()

Lifecycle — AActor dispatches. OnRegister publishes the component's ECS mirror. It runs when the actor joins a world, which is scene load in the editor — a placed actor is therefore visible and inspectable without playing. Put everything that only describes the actor here: it must be safe to run in the editor, must not spawn actors, and must not start anything that ticks. BeginPlay runs when the world begins play (PIE Play, or the first MWorld::Tick on a headless driver) and once per actor. Put gameplay startup here — playing audio, spawning a camera rig, seeding runtime state from config.

BeginPlay

C++
virtual void BeginPlay()

TickComponent

C++
virtual void TickComponent(float deltaSeconds)

EndPlay

C++
virtual void EndPlay()

PullFromMirror

C++
virtual void PullFromMirror(World* ecs, EntityID entity)

Inverse of the OnRegister push, run when an actor adopts an entity the scene loader already populated: read exactly the mirrored fields the push writes, before serialized actor deltas apply.

RefreshMirror

C++
virtual void RefreshMirror()

Re-publish the fields a component mirrors onto the ECS (its light, mesh, audio, ...). Each mirroring component overrides it; the base has nothing to push. Virtual so a writer that only knows the component — a script's property setter — can refresh what the renderer reads after a raw write.

GetOwner

C++
AActor* GetOwner() const

Owning actor — set by AActor::AddComponent when the component is attached. nullptr for unattached/orphaned components.

SetOwner

C++
void SetOwner(AActor* owner)

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

IsTransient

C++
bool IsTransient() const noexcept

Created by an editor-time actor for preview: AActor::ClearGeneratedContent removes it. Components are never saved by composition (the class constructor owns that), so this only marks what regeneration may drop; visible generated geometry belongs on a transient actor, whose ECS mirror is kept out of the level file as well.

SetTransient

C++
void SetTransient(bool transient) noexcept

IsInstanceComponent

C++
bool IsInstanceComponent() const

True for a component a designer added to this placed actor in the editor (FInstanceComponents), as opposed to one the class constructor creates. The serializer writes only these components' existence: constructor components come back with the class.

SetInstanceComponent

C++
void SetInstanceComponent(bool value)

AdvanceTickAccumulator

C++
bool AdvanceTickAccumulator(float deltaSeconds, float& outDelta)

Called by the owning actor's Tick: applies tickInterval pacing. Returns false to skip this frame; on true, outDelta carries the accumulated dt to tick with.

Generated from Game/MActorComponent.h via game.json · Nov 5, 2026Version 1.0.0