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
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
- Add
BPC_AutoDestroyto 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
| Property | When to change |
|---|---|
| Owner | Set 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 module. Expand an asset to see its members.
Components
BPC_AutoDestroy1 members
Lifetime component for spawned helper actors: at begin play it binds to the owning actor's own owner and destroys the helper when that owner goes. Nearly every helper the framework spawns carries one, and you should add it to any helper of your own that is spawned with an owner. With no owner it prints a warning and does nothing.
| Kind | Name | Signature | Description |
|---|---|---|---|
| event | OnDestroyed_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. |