Trigger¶
14 tools. Back to the index.
create_trigger¶
Additive.
Creates a trigger actor (TriggerBox or TriggerSphere) at a specified location. These two shapes only -- for a brush-based ATriggerVolume use create_volume(volume_type="TriggerVolume") or spawn_box_volume instead.
| Parameter | Type | Required | Description |
|---|---|---|---|
trigger_name |
string | yes | Name label for the trigger actor |
trigger_type |
string | no | Trigger class: "TriggerBox" (default) or "TriggerSphere". "TriggerVolume" is deliberately REJECTED here -- ATriggerVolume derives from AVolume/ABrush and needs a real UModel brush built for it, so spawning it through this path would hand you a success-shaped actor with no real collision; use create_volume(volume_type="TriggerVolume"), which builds that brush. |
location |
array | no | World [x, y, z] location to spawn the trigger (default 0,0,0) |
Returns: { trigger_name, trigger_type, actor_name, actor_path, success }
create_volume¶
Additive.
Spawn a BlockingVolume, KillZVolume, PainCausingVolume, PostProcessVolume or TriggerVolume in the editor world with a real cube brush, labelled volume_name, as one undo step; the level is not saved. Returns actor_name, actor_path, actor_class and brush_built. For other AVolume classes or box extents use spawn_box_volume.
| Parameter | Type | Required | Description |
|---|---|---|---|
volume_name |
string | yes | Editor label for the new actor; its object name is generated and returned as actor_name. |
volume_type |
string | no | Volume class, case-insensitive: "BlockingVolume" (default), "KillZVolume", "PainCausingVolume", "PostProcessVolume" or "TriggerVolume"; any other value spawns a BlockingVolume. |
location |
array | no | World location [x, y, z] in cm of the volume center (default [0, 0, 0]). |
size |
number | no | Edge length in cm of the cube brush (the full side, not a half-extent); omitted or not positive gives 200. |
Returns: { volume_name, volume_type, actor_name, actor_path, actor_class, brush_built, success }
get_actors_in_trigger¶
Read-only.
List 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}]; get_trigger_overlap_count returns only the count.
| Parameter | Type | Required | Description |
|---|---|---|---|
trigger_name |
string | yes | Object name of the trigger actor, such as the actor_name returned by create_trigger; its editor label is not matched. |
Returns: { trigger_name, actor_name, actor_class, actors, 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.
Retrieves information about a trigger actor, including its type and bounding box.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Name of the trigger actor to query |
Returns: { actor_name, actor_class, is_trigger_box, is_trigger_sphere, bounds_origin, bounds_extent }
get_trigger_overlap_count¶
Read-only.
Count the actors currently overlapping a TriggerBox, TriggerSphere or TriggerVolume in the editor world, without changing anything; the cheap form of get_actors_in_trigger. Returns actor_name and overlap_count. Fails if the first actor matching the name is not a trigger.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name or editor label of the trigger actor; the first actor matching either is used. |
Returns: { actor_name, overlap_count }
get_volume_info¶
Read-only.
Read a volume actor in the editor world without changing it: its class, whether it is a BlockingVolume, KillZVolume, PainCausingVolume or PostProcessVolume and, when it has a brush component, bounds_origin and bounds_extent as text plus has_brush. Fails if the actor is not an AVolume.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name of the volume actor in the editor world; its editor label is not matched. |
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_box¶
Destructive.
Delete a TriggerBox actor from the editor world after checking its class; the level is not saved. A missing actor or one of another class is not an error: the reply has deleted false and a note. Returns actor_name, actor_class, deleted and already_existed.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | no | Object name of the TriggerBox actor (its editor label is not matched); the command fails without it. |
Returns: { actor_name, actor_class, deleted, already_existed, note? }
remove_trigger_sphere¶
Destructive.
Delete a TriggerSphere actor from the editor world after checking its class; the level is not saved. A missing actor or one of another class is not an error: the reply has deleted false and a note. Returns actor_name, actor_class, deleted and already_existed.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | no | Object name of the TriggerSphere actor (its editor label is not matched); the command fails without it. |
Returns: { actor_name, actor_class, deleted, already_existed, 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. This is the counterpart of spawn_box_volume / create_volume; for a TriggerBox or TriggerSphere use remove_trigger_box / remove_trigger_sphere instead.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | no | 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; the level is marked dirty, not saved. Returns previous_extent, new_extent and changed. Each extent must be greater than 0.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name of the TriggerBox actor in the editor world; its editor label is not matched. |
extent_x |
number | yes | Half-extent along local X in cm, greater than 0; the box is twice as long. |
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; the level is marked dirty, not saved. Returns previous_radius, new_radius and changed. The radius must be greater than 0.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name of the TriggerSphere actor in the editor world; its editor label is not matched. |
radius |
number | yes | New unscaled sphere radius in cm, greater than 0. |
Returns: { actor_name, component_name, previous_radius, new_radius, changed }
spawn_box_volume¶
Additive.
USE THIS, NOT the plain actor spawners, for ANY AVolume-derived actor: it spawns the actor AND builds a real cube brush for it from a half-extent, so the volume actually encloses space. The generic spawners leave an EMPTY UModel brush -- zero bounds, which means 0 nav tiles and no overlap, an actor that looks spawned and does nothing. It then normalizes the residual scale some actor factories stamp on placement and RE-READS the resulting world bounds, so success means "the volume you got matches the volume you asked for", not "the call returned".
| Parameter | Type | Required | Description |
|---|---|---|---|
volume_class |
string | yes | Volume class: short reflected name ('NavMeshBoundsVolume', 'PhysicsVolume', 'TriggerVolume', 'BlockingVolume', 'PCGVolume', with or without a leading 'A') or a full object path ('/Script/Engine.TriggerVolume'). Must derive from AVolume (required). |
location |
array | no | World [x, y, z] location to spawn the volume (default 0,0,0) |
extent |
array | no | Required [x, y, z] in unreal units, each component > 0. !!! 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. |
actor_label |
string | no | Optional editor label for the spawned actor |
is_spatially_loaded |
boolean | no | World Partition spatial-loading flag (default true; only applied when the actor allows changing it). 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 } }