HomeModule plugins › AFM_AutoDestroy
Module

AFM_AutoDestroy

Destroys the owning actor when the actor it depends on is destroyed.

What it gives you

  • Automatic cleanup of helper actors
  • No manual lifetime tracking

Requires

None

Required by

AFM_Abilities AFM_MeshCopy AFM_Spawner AFM_Spline AFM_State AFM_WidgetInteraction AFS_Core_Pawn AFS_Core_Snapping AFS_UI AFS_UISpace_Hand AFS_UISpace_Pawn AFS_UI_Labels AFS_UX_Gaze AFS_UX_Grip AFS_UX_Teleporter

1 assets1 API members

Description

Many framework systems spawn helper actors — motion controllers, previews, indicators, cursors — that should not outlive whatever created them. BPC_AutoDestroy binds to the parent's destruction and removes its owner, so no system has to track those lifetimes manually.

Setup

  1. Enable AFM_AutoDestroy.
  2. Add BPC_AutoDestroy to any actor that should not outlive its parent.

Usage

Add the component and set the owning actor. When that actor is destroyed, this one follows. There is nothing to call.

Key properties

PropertyWhen to change
OwnerSet at spawn time by whatever creates the helper

Extending

Not typically extended.

Example map

Present on BP_MotionController so hands clean up with the pawn.

Troubleshooting

Helper actors survive their parent. The component is missing, or the owner was never assigned at spawn.

API reference

Every blueprint asset in this plugin. Expand an asset to see its members.

Components

BPC_AutoDestroy1 members
extends ActorComponent
KindNameSignatureDescription
eventOnDestroyed_Event(DestroyedActor: Actor)Destroys the owning actor when the actor it depends on is destroyed. Used so helper actors such as motion controllers clean up with their pawn.