Trigger¶
10 tools for trigger and volume actors: spawning, shaping, their events and what is inside them.
Back to the index.
get_actors_in_trigger¶
Read-only
List and count the actors that a TriggerBox, TriggerSphere or TriggerVolume in the editor world (not PIE) currently reports as overlapping (AActor::GetOverlappingActors), without changing anything. Returns actor_count and actors [{actor_name, actor_class}], plus the trigger's own object name and class. The first actor whose object name or editor label matches is used; when it is not a trigger the call fails.
| Parameter | Type | Required | Description |
|---|---|---|---|
trigger_name |
string | yes | Object name or editor label of the trigger actor, such as the actor_name returned by spawn_actor. |
Returns: { trigger_name, actor_name (the trigger's object name), actor_class (the trigger's class), actors: [{actor_name, actor_class}], actor_count }
get_trigger_events¶
Read-only
Read the overlap-event configuration of an actor's primitive component: collision profile, whether overlap events are enabled at all, and which begin/end overlap handlers are actually bound. Read-only inverse of set_trigger_events -- it changes nothing, so it is the way to check a trigger is really armed before blaming the gameplay code.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Name of the actor (must have a primitive/collision component). |
Returns: { actor_name, component_name, collision_profile, overlap_events_enabled, begin_overlap_bound, end_overlap_bound, callback_bound }
get_trigger_info¶
Read-only
Read what kind of trigger an editor-world actor is and where it reaches: actor_class, is_trigger_box, is_trigger_sphere, and the world-space bounds of its root collision shape as bounds_origin and bounds_extent (half-size, cm, as "X=.. Y=.. Z=.." text; left out when the root is not a primitive). Use get_actors_in_trigger for what it overlaps now, get_trigger_events for its overlap and collision settings, get_volume_info for other volumes; resize with set_trigger_box_extent or set_trigger_sphere_radius. Read-only and idempotent; editor world only, not PIE. An unknown name, or an actor that is not a TriggerBox, TriggerSphere or TriggerVolume, is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name (not the editor label) of the trigger actor in the editor world, e.g. "TriggerBox_0", as spawn_actor returns it; whole name, case-insensitive. find_actors_by_name maps a label to its name |
Returns: { actor_name, actor_class, is_trigger_box, is_trigger_sphere, bounds_origin, bounds_extent }
get_volume_info¶
Read-only
Read a volume actor (any AVolume: BlockingVolume, KillZVolume, PainCausingVolume, PostProcessVolume, TriggerVolume, NavMeshBoundsVolume...) in the editor world without changing it: its class, a flag for each of four common kinds (blocking, kill-Z, pain-causing, post-process) and, when it has a brush component, the world-space bounds of that brush as bounds_origin and bounds_extent (half-size, cm, as "X=.. Y=.. Z=.." text) plus has_brush (whether brush geometry is assigned; without it the volume encloses nothing). Use it to check a volume made by spawn_box_volume; for a TriggerBox or TriggerSphere use get_trigger_info, for overlap settings get_trigger_events, for kind-specific settings get_properties; delete one with remove_volume. Editor world only, not PIE. An unknown name, or an actor that is not a volume, is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name of the volume actor in the editor world, e.g. "BlockingVolume_0", as spawn_box_volume returns it; its editor label is not matched (find_actors_by_name maps a label to its name). |
Returns: { actor_name, actor_class, is_blocking_volume, is_killz_volume, is_pain_causing_volume, is_post_process_volume, bounds_origin?, bounds_extent?, has_brush? }
remove_trigger¶
Destructive Idempotent
Delete one shape trigger -- a TriggerBox, TriggerSphere or TriggerCapsule -- from the editor world. The actor is found by its object name and its class is checked first: any other class, a TriggerVolume included, is refused and nothing is destroyed. The deletion records no undo step and does not save the level (save_level does). A name that matches no actor is a success with deleted=false, so a repeat call is harmless (idempotent). For a brush volume use remove_volume; to delete any actor with undo, delete_actor.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | The trigger's object name, not its editor label (e.g. TriggerBox_0, as get_actors_in_trigger reports it in actor_name); matched without case. |
Returns: { actor_name, actor_class, deleted (false when nothing was destroyed), already_existed (false when no actor had that name), note? }
remove_volume¶
Destructive
Destroy a volume ACTOR in the world -- any AVolume subclass: BlockingVolume, PainCausingVolume, PostProcessVolume, TriggerVolume and the rest. Typed: it verifies the actor really is an AVolume before deleting, so pointing it at a non-volume actor is refused rather than obeyed (success false, deleted false, nothing destroyed). This is the counterpart of spawn_box_volume; for a TriggerBox, TriggerSphere or TriggerCapsule use remove_trigger instead.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Name of the AVolume actor. |
Returns: { actor_name, actor_class, deleted, already_existed, note? }
set_trigger_box_extent¶
Destructive Idempotent
Resize a TriggerBox in the editor world by setting the unscaled half-extent of its box collision component and updating its overlaps, in one undo step; the level is marked dirty, not saved (save_level). For a TriggerSphere use set_trigger_sphere_radius; a brush volume such as a TriggerVolume has no resize tool. Read the result with get_trigger_info (bounds, which include the actor scale) and what now overlaps with get_actors_in_trigger. Idempotent: the same extent again reports changed=false, though the level is still marked dirty. An extent of 0 or less or a missing one, an unknown name, an actor that is not a TriggerBox, or one without a box collision component is an error and nothing changes.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name of the TriggerBox actor in the editor world, e.g. "TriggerBox_0", as spawn_actor returns it; its editor label is not matched (find_actors_by_name maps a label to its name). |
extent_x |
number | yes | Half-extent along local X in cm, greater than 0, e.g. 200; the box is twice as long, and the actor scale multiplies it in the world. |
extent_y |
number | yes | Half-extent along local Y in cm, greater than 0. |
extent_z |
number | yes | Half-extent along local Z in cm, greater than 0. |
Returns: { actor_name, component_name, previous_extent: {x, y, z}, new_extent: {x, y, z}, changed }
set_trigger_events¶
Destructive Idempotent
Configure overlap-event generation on a trigger/volume's root primitive component: applies the built-in 'Trigger' collision profile (QueryOnly with overlap responses) and toggles SetGenerateOverlapEvents. Honesty note: this configures the component to FIRE overlap events, but binding an actual OnComponentBeginOverlap / OnActorBeginOverlap callback requires a Blueprint or native C++ class on the actor -- the cmd reports callback_bound=false to make that explicit.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Trigger/volume actor name (required) |
generate_overlap_events |
boolean | no | Whether the component generates overlap events (default true) |
Returns: { actor_name, component_name, collision_profile, overlap_events_enabled, message, callback_bound, success }
set_trigger_sphere_radius¶
Destructive Idempotent
Resize a TriggerSphere in the editor world by setting the unscaled radius of its sphere collision component and updating its overlaps, in one undo step; the level is marked dirty, not saved (save_level). Returns previous_radius, new_radius and changed. For a TriggerBox use set_trigger_box_extent; for a brush volume such as a TriggerVolume there is no resize tool. Read the result with get_trigger_info (bounds, which include the actor scale) and what now overlaps with get_actors_in_trigger. Idempotent: the same radius again reports changed=false, though the level is still marked dirty. A radius of 0 or less, an unknown name, an actor that is not a TriggerSphere, or one without a sphere collision component is an error and nothing changes.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name of the TriggerSphere actor in the editor world, e.g. "TriggerSphere_0", as spawn_actor returns it; its editor label is not matched. |
radius |
number | yes | New unscaled sphere radius in cm, greater than 0, e.g. 250; the actor scale multiplies it in the world. |
Returns: { actor_name, component_name, previous_radius, new_radius, changed }
spawn_box_volume¶
Additive
Spawn ANY AVolume-derived actor (default BlockingVolume) in the editor world AND build a real cube brush for it from a half-extent, so the volume actually encloses space: spawn_actor has no volume types, and a volume spawned without a brush has zero bounds -- 0 nav tiles, no overlap. It then normalizes the residual scale some actor factories stamp on placement (PCGVolume: 25,25,10) and RE-READS the brush bounds, so success means the volume matches the extent you asked for, not that the call returned. One more step finishes the typed volumes: add_pcg_component(graph) on a PCGVolume, set_properties {"AreaClass": ...} on a NavModifierVolume, {"bUnbound": true} on an unbound PostProcessVolume; spawn_level_streaming_volume binds a sub-level. Called with no class and no extent it gives a 200 cm BlockingVolume cube. One undo step; refused during PIE; the level is not saved.
| Parameter | Type | Required | Description |
|---|---|---|---|
volume_class |
string | no | Optional volume class (default "BlockingVolume"): short reflected name ('BlockingVolume', 'KillZVolume', 'PainCausingVolume', 'PostProcessVolume', 'TriggerVolume', 'NavMeshBoundsVolume', 'PhysicsVolume', 'PCGVolume', case-insensitive, with or without a leading 'A') or a full object path ('/Script/Engine.TriggerVolume'). Must be a concrete AVolume subclass; anything else is an error. |
location |
array | no | World [x, y, z] location to spawn the volume (default 0,0,0) |
extent |
array | no | Optional [x, y, z] in unreal units, each component > 0; default [100, 100, 100] (a 200 cm cube). !!! THIS IS THE SEMI-AXIS (HALF-size), NOT the full edge length !!! extent=[500,500,200] builds a 1000 x 1000 x 400 cube and, with the scale normalized, gives world bounds of +/-500 / +/-200 around location. Check bounds_extent_actual against what you asked for. A value that is not an array is an error. |
actor_label |
string | no | Optional editor label for the spawned actor |
is_spatially_loaded |
boolean | no | Optional World Partition spatial-loading flag. Applied only when passed and the actor allows changing it (spatial_flag_applied); omitted, the actor keeps its class default. Reported RE-READ from the actor. |
normalize_scale |
boolean | no | Default TRUE: resets the actor scale to (1,1,1) after building the brush, so the world bounds equal the requested extent. It matters because some actor factories stamp a default scale during placement -- APCGVolume is spawned at (25, 25, 10) -- and since brush polys are authored in LOCAL space that scale MULTIPLIES your extent. Set it false only if you deliberately want the factory's scale; spawn_scale always reports what it was. Be aware that with normalize_scale=false and a factory scale != 1 the real bounds are NOT the requested extent, so extent_matches_request and therefore success come back FALSE -- that is the honest answer, not a bug, and actor_scale says why they differ. |
Returns: { actor_name, actor_path, actor_class, volume_class, world_bounds_extent: [x,y,z] (RE-READ, GetActorBounds -- kept for compatibility), bounds_extent_actual: [x,y,z] (RE-READ from the BRUSH component's world bounds; this is the volume itself, with no stray editor sprite in the box), bounds_origin_actual: [x,y,z], actor_scale: [x,y,z] (RE-READ, after normalization), spawn_scale: [x,y,z] (RE-READ, as the actor factory left it), scale_normalized: bool (true only when a correction was actually needed), extent_matches_request: bool, bounds_tolerance_uu: number, has_brush_geometry, brush_built, is_spatially_loaded (RE-READ), spatial_flag_applied, success, requested: { volume_class, location, extent, actor_label, is_spatially_loaded, normalize_scale } }