SmartObjects¶
26 tools for Smart Object definitions, slots, behaviors, tags and annotations, and claiming and using them.
Back to the index.
add_smart_object_definition_default_behavior¶
Additive
Add a definition-level default behavior, a new instance of the class named by behavior_class, to a USmartObjectDefinition asset, in one undo step, then save it: slots without a behavior of their own use the defaults. The private DefaultBehaviorDefinitions array is reached through reflection. The class is a short native name or a /Script path and must derive from USmartObjectBehaviorDefinition; an unknown, abstract or unrelated class is an error before anything changes. Every call adds another default. A failed save makes success false with saved=false and save_error. Inverse: remove_smart_object_definition_default_behavior; per slot: add_smart_object_slot_behavior_definition.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
behavior_class |
string | yes | Behavior class: short native name or /Script path; must derive from USmartObjectBehaviorDefinition |
Returns: { definition_path: string, behavior_class: string, default_behavior_count: int, added: bool, saved: bool, save_error?: string }
add_smart_object_slot¶
Additive Idempotent
Append a named activity slot, enabled, to a USmartObjectDefinition asset, in one undo step, then save it. Idempotent on name: when a slot named slot_name is already there, nothing is added, written or saved (already_existed true, changed false, saved false), and activity_tag is not applied to it. activity_tag (default Default) is added to the new slot only when it is a registered gameplay tag, though the reply echoes it either way, so read the slot back with get_smart_object_slots_detail. A missing definition is an error; a failed save makes success false with saved=false and save_error. Inverse: remove_smart_object_slot; its tags: set_smart_object_slot_activity_tags.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
slot_name |
string | yes | Unique name for the new slot |
activity_tag |
string | no | Optional FGameplayTag to attach to the slot; defaults to "Default" |
Returns: { definition_path: string, slot_name: string, activity_tag: string, slot_count: int, added?: bool, already_existed?: bool, changed: bool, saved: bool, save_error?: string, note?: string }
add_smart_object_slot_behavior_definition¶
Additive
Add a behavior definition, a new instance of the class named by behavior_class, to the behaviors of the slot at slot_index in a USmartObjectDefinition asset, in one undo step, then save it. The class is a short native name or a /Script path and must derive from USmartObjectBehaviorDefinition, e.g. GameplayBehaviorSmartObjectBehaviorDefinition; an unknown, abstract or unrelated class is an error before anything changes. Every call adds another behavior, even of a class the slot already has. A behavior on every slot, or a default one, is what register_smart_object_actor needs. A failed save makes success false with saved=false and save_error. Inverse: remove_smart_object_slot_behavior_definition; for all slots: add_smart_object_definition_default_behavior.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
slot_index |
integer | yes | Index of the slot to attach the behavior to |
behavior_class |
string | yes | Behavior class: short native name (e.g. "GameplayBehaviorSmartObjectBehaviorDefinition") or full /Script path |
Returns: { definition_path: string, slot_index: int, behavior_class: string, behavior_count: int, saved: bool, save_error?: string }
add_smart_object_slot_entrance_annotation¶
Additive
Add an entrance annotation (an entry and/or exit point) to the slot at slot_index in a USmartObjectDefinition asset, with its offset, rotation, tags and navigation and trajectory fields, in one undo step, then save it. A field not given keeps the engine default, and every call adds another entrance. An invalid selection_priority, a missing definition or an invalid slot_index is an error before anything changes; a failed save makes success false with saved=false and save_error. entrance_count counts the slot's entrances and data_count all its definition data. Read them back with get_smart_object_slot_entrance_annotations; inverse: remove_smart_object_slot_entrance_annotation.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
slot_index |
integer | yes | Index of the slot to add the entrance to |
offset |
array | no | Optional [x, y, z] local-space offset of the entrance |
rotation |
array | no | Optional [pitch, yaw, roll] local-space rotation (degrees) |
is_entry |
boolean | no | Optional: entrance can be used to enter the slot (default true) |
is_exit |
boolean | no | Optional: entrance can be used to exit the slot (default true) |
tags |
array | no | Optional gameplay tag names identifying the entrance |
trace_ground_location |
boolean | no | Optional: adjust ground location with a line trace (default true). |
check_transition_trajectory |
boolean | no | Optional: check collisions on the transition from nav location to slot (default false). |
selection_priority |
string | no | Optional entrance selection priority: Lowest|Lower|Low|BelowNormal|Normal|AboveNormal|High|Higher|Highest (default Normal). |
trajectory_start_height_offset |
number | no | Optional height offset at the start of the transition check (default 80). |
trajectory_slot_height_offset |
number | no | Optional height offset at the slot for the transition check (default 40). |
transition_check_radius |
number | no | Optional radius of the transition trajectory check (default 10). |
Returns: { definition_path: string, slot_index: int, entrance_count: int, data_count: int, saved: bool, save_error?: string }
claim_smart_object¶
Destructive
Reserve the first free slot of the Smart Object component of an editor-world actor (USmartObjectSubsystem::MarkSlotAsClaimed, Normal priority, no user), so other users see it taken; claim_handle and slot_id identify it. To claim and mark the slot occupied in one call use use_smart_object; to find objects by area find_smart_objects. The component must be registered with the subsystem first (register_smart_object_actor; get_smart_object_component_definition shows registered), and the definition needs a behavior or it never registers. The claim is runtime subsystem state: not saved, no undo step. Each call claims another free slot, and once all are claimed the call is an error. Release goes through release_smart_object with actor_label, which unregisters the whole component and frees all its claims; the claim_handle string cannot be passed back. success is false, with an error, when the claim does not read back valid.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label (not the object name) of the editor-world actor carrying the USmartObjectComponent, e.g. "SO_Bench_1", as register_smart_object_actor set it; whole label, case-insensitive, first match wins |
definition_path |
string | no | Optional path to the definition; only echoed back in the reply, never loaded or checked |
Returns: { actor_label: string, definition_path: string, claim_handle: string, slot_id: string, is_claimed: bool, success: bool }
create_smart_object_definition¶
Additive Idempotent
Create a USmartObjectDefinition asset at package_path/definition_name, or load the one already there, add default slots (enabled, no tags) until it has num_activity_slots, then save it. Slots already there are kept and never taken away; created says whether the asset is new. A definition that already has at least that many slots changes and saves nothing (changed false, saved false), so a repeat call is idempotent. A name taken by another asset class, or a path that is not an asset path, is an error; a failed save, as during PIE, makes success false with saved=false and save_error. Slots added to an existing definition are one undo step; a new asset is not undoable. Named slots: add_smart_object_slot; slot fields: set_smart_object_slot_activity_tags or set_smart_object_slot_enabled; a behavior, which register_smart_object_actor needs: add_smart_object_definition_default_behavior or add_smart_object_slot_behavior_definition; read back: get_smart_object_definition_summary.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_name |
string | yes | Name for the new Smart Object definition, also its asset name |
package_path |
string | no | Content folder; defaults to /Game/MCP |
num_activity_slots |
integer | no | Slot count to reach, default 1: slots are added until the definition has this many, none are taken away |
Returns: { definition_path: string, definition_name: string, num_slots: int, created: bool, changed: bool, saved: bool, save_error?: string, note?: string }
find_smart_objects¶
Read-only
Spatially query the SmartObject subsystem for slots within a box centered on a point (USmartObjectSubsystem::FindSmartObjects). HONEST GATE: the spatial index only populates once the subsystem runtime is initialized (BeginPlay/PIE); in the editor/headless world it is empty, so this returns success with an empty results list and a note rather than fabricating hits.
| Parameter | Type | Required | Description |
|---|---|---|---|
center |
array | yes | [x, y, z] world-space center of the search box |
radius |
number | yes | Half-extent (uu) of the AABB search box around center |
include_claimed |
boolean | no | Optional: also return already-claimed slots (default false) |
include_disabled |
boolean | no | Optional: also return disabled slots (default false) |
offset |
integer | no | Index of the first entry returned, counted from 0 (default 0). Read the next page at the reply's next_offset. |
limit |
integer | no | Most entries returned per call, 1..1000 (default 100). |
Returns: { center: [number, number, number], radius: number, results: [{ object_handle: string, slot_handle: string, actor_label: string }], count: int (entries in this page), total: int, offset: int, limit: int, returned: int, truncated: bool, next_offset: int|null, note?: string } -- results sorted by slot_handle
get_smart_object_component_definition¶
Read-only
Read which USmartObjectDefinition the USmartObjectComponent of an editor-world actor references (definition, as an object path; has_definition=false and an empty string when none) and whether the component is registered with the editor world's SmartObjectSubsystem (registered, a valid handle), which claim_smart_object and use_smart_object need. The read side of set_smart_object_component_definition; register_smart_object_actor spawns an actor with one. To read the definition asset itself use get_smart_object_definition_summary or get_smart_object_slots_detail. Read-only and idempotent. A label no actor has, or an actor without the component, is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label (not the object name) of the editor-world actor carrying the USmartObjectComponent, e.g. "SO_Bench_1"; whole label, case-insensitive, first match wins. find_actors_by_name with match='label' finds labels |
Returns: { actor_label: string, definition: string, has_definition: bool, registered: bool }
get_smart_object_definition_summary¶
Read-only
Read the object-level state of a USmartObjectDefinition asset without changing it: its activity tags with their merging policy, the user-tag filtering policy and whether the object-level user filter is empty, the slot count, the default behavior count, and bounds around every slot in the object local space (slot offsets plus the default slot size, not world space). It also runs the engine Validate() pass: is_valid, and validation_errors with the messages of every severity. It also gives slot_activity_tags, the union of the activity tags of every slot (object-level activity_tags excluded), and registered_actor_count, how many smart object components registered with the editor-world SmartObjectSubsystem use this definition (0 without that subsystem). A missing definition_path, or one that does not load, is an error. Per-slot fields: get_smart_object_slots_detail; entrances: get_smart_object_slot_entrance_annotations; edit the object level with set_smart_object_definition_activity_tags or set_smart_object_definition_user_tag_filter.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Object path of the USmartObjectDefinition asset, e.g. /Game/AI/SO_Bench.SO_Bench |
Returns: { definition_path: string, slot_count: int, activity_tags: [string], slot_activity_tags: [string], registered_actor_count: int, merging_policy: string, filtering_policy: string, user_filter_is_empty: bool, bounds: { min: [number, number, number], max: [number, number, number] }, is_valid: bool, validation_errors: [string], default_behavior_count: int }
get_smart_object_slot_entrance_annotations¶
Read-only
List a slot's entrance annotations with all their fields (round-trip reader for add_smart_object_slot_entrance_annotation, including the navigation/trajectory fields).
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset. |
slot_index |
integer | yes | Index of the slot to read. |
Returns: { definition_path: string, slot_index: int, entrance_count: int, entrances: [ { offset: [float], rotation: [float], is_entry: bool, is_exit: bool, tags: [string], trace_ground_location: bool, check_transition_trajectory: bool, selection_priority: string, trajectory_start_height_offset: float, trajectory_slot_height_offset: float, transition_check_radius: float } ] }
get_smart_object_slots_detail¶
Read-only
List every slot of a USmartObjectDefinition asset with its index, name, enabled flag, offset [x, y, z] in cm and rotation [pitch, yaw, roll] in degrees relative to the owner, activity_tags, whether its user tag filter is empty, its behavior classes and counts, data_count and entrance_count. Use it to find the slot_index the set_smart_object_slot_* and remove_smart_object_slot tools take, and to read back their edits; for object-level state (tags, policies, bounds, validation) use get_smart_object_definition_summary, and for entrance fields get_smart_object_slot_entrance_annotations. Read-only and idempotent; reads the asset, not a placed actor. A definition with no slots gives slot_count 0. A missing or unloadable definition_path is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Object path of the USmartObjectDefinition asset, e.g. "/Game/AI/SO_Bench.SO_Bench" (the package path "/Game/AI/SO_Bench" also loads); create_smart_object_definition makes one |
Returns: { definition_path: string, slot_count: int, slots: [{ index: int, name: string, enabled: bool, offset: [number, number, number], rotation: [number, number, number], activity_tags: [string], user_filter_is_empty: bool, behavior_count: int, behavior_classes: [string], data_count: int }] }
register_smart_object_actor¶
Additive
Spawn an empty actor in the editor world, attach a USmartObjectComponent pointing at the given definition, and register it with USmartObjectSubsystem. Note: the definition must already have a behavior definition (per-slot or default) or the subsystem silently rejects the handle (see handle_valid).
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label for the new actor |
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
location |
array | no | Optional [x, y, z] world location; defaults to (0,0,0) |
Returns: { actor_label: string, actor_name: string, definition_path: string, has_component: bool, registered: bool, handle_valid: bool }
release_smart_object¶
Destructive
Release a Smart Object claim. The only headless-safe path is to pass actor_label so the subsystem can unregister the component (which releases any claim it holds). FSmartObjectUserHandle is private in UE 5.7, so a claim_handle-only path is not possible without a C++ extension.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | no | Optional editor label of the actor whose component to unregister (releases all its claims) |
claim_handle |
string | no | Optional canonical claim string; documented limitation: round-trip is not public in 5.7 |
Returns: { actor_label: string, released: bool } | (error: "release_smart_object: ...")
remove_smart_object_definition_default_behavior¶
Destructive
Remove one definition-level default behavior (the ones slots without a behavior of their own use), found by its index in the private DefaultBehaviorDefinitions array, from a USmartObjectDefinition asset loaded by path, then save it. The array is reached through reflection, later entries shift down one index, and the removal is one undo step. A behavior_index outside the array is a success with removed=false, already_absent=true and saved=false, nothing touched, and an omitted one is an error; a repeat call with an index still in range removes the next default. default_behavior_count is what is left. A missing definition is an error; a failed save gives success false, saved=false and save_error, with the removal kept in memory. Add one: add_smart_object_definition_default_behavior; count them: get_smart_object_definition_summary; per-slot behaviors: remove_smart_object_slot_behavior_definition.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
behavior_index |
integer | yes | Index into DefaultBehaviorDefinitions to remove |
Returns: { definition_path: string, behavior_index: int, default_behavior_count: int, removed: bool, already_absent: bool, saved: bool, save_error?: string }
remove_smart_object_slot¶
Destructive
Remove the slot at slot_index from a USmartObjectDefinition asset, together with its behaviors, tags and annotations; later slots shift down one index, so re-read indices with get_smart_object_slots_detail. Saves the asset; a failed save returns an error with the removal kept in memory. An invalid slot_index is an error. Undoable (one editor transaction). To turn a slot off while keeping indices stable use set_smart_object_slot_enabled; add_smart_object_slot appends one.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
slot_index |
integer | yes | Index of the slot to remove |
Returns: { definition_path: string, slot_index: int, slot_count: int, removed: bool, saved: bool, save_error?: string }
remove_smart_object_slot_behavior_definition¶
Destructive
Remove one behavior definition, found by its position in the slot's BehaviorDefinitions, from the slot at slot_index of a USmartObjectDefinition asset loaded by path, in one undo step, then save it; later behaviors shift down one index. slot_index must name a slot: an omitted or invalid one is an error. A behavior_index outside the array is a success with removed=false, already_absent=true and saved=false, nothing touched; an omitted one is an error. Because indices shift, repeating a call with an index still in range removes the next behavior: re-read the counts with get_smart_object_slots_detail between calls. A missing definition is an error; a failed save gives success false, saved=false and save_error, with the removal kept in memory. Add one: add_smart_object_slot_behavior_definition; definition-wide defaults: remove_smart_object_definition_default_behavior; the whole slot: remove_smart_object_slot.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset. |
slot_index |
integer | yes | Index of the slot to edit. |
behavior_index |
integer | yes | Index into the slot's BehaviorDefinitions to remove. |
Returns: { definition_path: string, slot_index: int, behavior_index: int, behavior_count: int, removed: bool, already_absent: bool, saved: bool, save_error?: string }
remove_smart_object_slot_entrance_annotation¶
Destructive
Remove one entrance annotation (an entry or exit point) from the slot at slot_index of a USmartObjectDefinition asset loaded by path, in one undo step, then save it. entrance_index counts only the entrance annotations in the slot's DefinitionData, numbered as add_smart_object_slot_entrance_annotation and get_smart_object_slot_entrance_annotations number them; other annotations are skipped and kept. slot_index must name a slot: an omitted or invalid one is an error. An entrance_index matching no entrance is a success with removed=false, already_absent=true and saved=false, nothing touched, and an omitted one is an error; a repeat call with an index still in range removes the next entrance. entrance_count and data_count are what is left. A failed save gives success false, saved=false and save_error, with the removal kept in memory. The whole slot: remove_smart_object_slot.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
slot_index |
integer | yes | Index of the slot to edit |
entrance_index |
integer | yes | Index among the slot's entrance annotations to remove (0-based; entrances only, not all definition data) |
Returns: { definition_path: string, slot_index: int, entrance_index: int, entrance_count: int, data_count: int, removed: bool, already_absent: bool, saved: bool, save_error?: string }
set_smart_object_component_definition¶
Destructive Idempotent
Set the USmartObjectDefinition that the USmartObjectComponent of an actor in the editor world references, found by actor_label, in one undo step when the component is transactional. The level is marked dirty and nothing is saved. A component that already references that definition is left as it is (changed false). A component bound to the Smart Object simulation is refused before anything changes, since the engine ignores the change then: unregister it with release_smart_object and actor_label first. set is read back from the component's reference and makes success false when it did not take. A missing actor, component or definition is an error. Read back with get_smart_object_component_definition; spawn one with register_smart_object_actor.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label of the actor carrying the USmartObjectComponent |
definition_path |
string | yes | Path to the USmartObjectDefinition asset to assign |
Returns: { actor_label: string, definition_path: string, definition: string, registered: bool, set: bool, changed: bool, note?: string }
set_smart_object_definition_activity_tags¶
Destructive Idempotent
Replace the object-level activity tags of a USmartObjectDefinition asset with activity_tags, optionally set its activity-tag merging policy and user-tag filtering policy, in one undo step, then save it. The whole tag container is written: an omitted or empty list empties it, and names that are not registered gameplay tags are skipped silently (compare activity_tags in the reply); an omitted policy keeps its value. A missing definition or an unknown policy name is an error checked before anything is written, so the definition stays as it was. A call that leaves tags and policies as they were changes and saves nothing (changed false), and a failed save, as during PIE, makes success false. Per-slot tags: set_smart_object_slot_activity_tags; object-level user filter: set_smart_object_definition_user_tag_filter; read back: get_smart_object_definition_summary.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
activity_tags |
array | no | Gameplay tag names for the definition's object-level activity tags; the list replaces the current tags whole |
merging_policy |
string | no | Optional activity-tag merging policy: "Combine" (default) or "Override"; Combine merges slot and object tags, Override lets non-empty slot tags take their place; omitted keeps the current policy |
filtering_policy |
string | no | Optional user-tag filtering policy: "NoFilter", "Combine", or "Override"; how the object and slot user filters apply to a request; omitted keeps the current policy |
Returns: { definition_path: string, activity_tags: [string], merging_policy: string, filtering_policy: string, changed: bool, saved: bool, save_error?: string, note?: string }
set_smart_object_definition_user_tag_filter¶
Destructive Idempotent
Replace the object-level user tag filter of a USmartObjectDefinition asset (the gameplay tag query a user must pass to use the object) with one built from user_tags and match (any, all or none of the tags), in one undo step, then save it. Unregistered tag names are skipped (the reply lists the tags kept); a list of only such names, or any other match, is an error before anything changes. An empty or omitted user_tags clears the filter (cleared true): an empty filter refuses no user. A call that leaves the filter as it was saves nothing (changed false). A missing definition is an error; a failed save, as during PIE, makes success false. How it combines with slot filters: filtering_policy of set_smart_object_definition_activity_tags; per-slot filter: set_smart_object_slot_user_tag_filter; read back: get_smart_object_definition_summary.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
user_tags |
array | no | Gameplay tag names the filter query matches against; unregistered names are skipped, and an empty list clears the filter |
match |
string | no | Match mode: "any" (default), "all", or "none"; any other value is an error |
Returns: { definition_path: string, user_tags: [string], match: string, filter_is_empty: bool, changed: bool, cleared: bool, saved: bool, save_error?: string, note?: string }
set_smart_object_slot_activity_tags¶
Destructive Idempotent
Set the activity tags of the slot at slot_index in a USmartObjectDefinition asset (which activities the slot supports), in one undo step, then save it. The list is written whole: an omitted or empty list empties the tags, and names that are not registered gameplay tags are skipped silently, so compare activity_tags in the reply. A slot that already has exactly those tags changes and saves nothing (changed false, saved false). A missing definition or an invalid slot_index is an error; a failed save makes success false with saved=false and save_error. Object-level tags: set_smart_object_definition_activity_tags; runtime tags: set_smart_object_slot_runtime_tags; read back: get_smart_object_slots_detail.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
slot_index |
integer | yes | Index of the slot to edit (from get_smart_object_slots_detail) |
activity_tags |
array | no | Gameplay tag names to set as the slot's activity tags; tags not registered are skipped |
Returns: { definition_path: string, slot_index: int, activity_tags: [string], changed: bool, saved: bool, save_error?: string, note?: string }
set_smart_object_slot_enabled¶
Destructive Idempotent
Set the authored enabled flag (bEnabled) of the slot at slot_index in a USmartObjectDefinition asset, then save it: the initial state that smart objects built from this definition start with. enabled defaults to true when omitted. An invalid slot_index is an error, and a failed save returns an error with the change kept in memory. Undoable (one editor transaction); a slot that already has that flag changes and saves nothing (changed false, saved false). Use remove_smart_object_slot to delete the slot instead, and get_smart_object_slots_detail to read slots back.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
slot_index |
integer | yes | Index of the slot to edit |
enabled |
boolean | no | Whether the slot is enabled |
Returns: { definition_path: string, slot_index: int, enabled: bool, changed: bool, saved: bool, save_error?: string, note?: string }
set_smart_object_slot_runtime_tags¶
Destructive Idempotent
Set the initial runtime tags of the slot at slot_index in a USmartObjectDefinition asset (the tags each smart object built from it starts the slot with), in one undo step, then save it. The list is written whole: an omitted or empty list empties the tags, and names that are not registered gameplay tags are skipped silently, so compare runtime_tags in the reply. A slot that already has exactly those tags changes and saves nothing (changed false, saved false). A missing definition or an invalid slot_index is an error; a failed save makes success false with saved=false and save_error. Activity tags: set_smart_object_slot_activity_tags; read back: get_smart_object_slots_detail.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset. |
slot_index |
integer | yes | Index of the slot to edit. |
runtime_tags |
array | no | Gameplay tag names to set as the slot's runtime tags. |
Returns: { definition_path: string, slot_index: int, runtime_tags: [string], changed: bool, saved: bool, save_error?: string, note?: string }
set_smart_object_slot_transform¶
Destructive Idempotent
Set the local offset and/or rotation (degrees) of the slot at slot_index in a USmartObjectDefinition asset, relative to the smart object's owner, then save it. Each of offset and rotation is written only when given with 3 numbers; otherwise it keeps its value. An invalid slot_index is an error, and a failed save returns an error with the change kept in memory. Undoable (one editor transaction); a request that leaves both as they were changes and saves nothing (changed false, saved false). Read slots back with get_smart_object_slots_detail; set_smart_object_slot_enabled and set_smart_object_slot_activity_tags edit other slot fields.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
slot_index |
integer | yes | Index of the slot to edit |
offset |
array | no | Optional [x, y, z] local offset |
rotation |
array | no | Optional [pitch, yaw, roll] local rotation (degrees) |
Returns: { definition_path: string, slot_index: int, offset: [number, number, number], rotation: [number, number, number], changed: bool, saved: bool, save_error?: string, note?: string }
set_smart_object_slot_user_tag_filter¶
Destructive Idempotent
Replace the user tag filter of the slot at slot_index in a USmartObjectDefinition asset (the gameplay tag query a user must pass to use the slot) with one built from user_tags and match (any, all or none of the tags), in one undo step, then save it. Unregistered tag names are skipped (the reply lists the tags kept); a list of only such names, or any other match, is an error before anything changes. An empty or omitted user_tags clears the filter (cleared true): an empty filter refuses no user, though under the Override policy the object-level filter then applies. A call that leaves the filter as it was saves nothing (changed false). A missing definition or an invalid slot_index is an error; a failed save, as during PIE, makes success false. Object-level filter: set_smart_object_definition_user_tag_filter; read slots back: get_smart_object_slots_detail.
| Parameter | Type | Required | Description |
|---|---|---|---|
definition_path |
string | yes | Path to the USmartObjectDefinition asset |
slot_index |
integer | yes | Zero-based index of the slot to edit (see get_smart_object_slots_detail); out of range is an error |
user_tags |
array | no | Gameplay tag names the filter query matches against; unregistered names are skipped, and an empty list clears the filter |
match |
string | no | Match mode: "any" (default), "all", or "none"; any other value is an error |
Returns: { definition_path: string, slot_index: int, user_tags: [string], match: string, filter_is_empty: bool, changed: bool, cleared: bool, saved: bool, save_error?: string, note?: string }
use_smart_object¶
Destructive Idempotent
Claim a free slot on an actor's SmartObject component and immediately mark it occupied (USmartObjectSubsystem::MarkSlotAsOccupied), driving a behavior definition. Single-call claim+occupy keyed by actor_label (an FSmartObjectClaimHandle cannot be rebuilt from a string, so a two-step claim_handle path is impossible). HONEST GATE: the component handle only registers once the subsystem runtime is initialized (PIE/BeginPlay); headless it is invalid and this returns a clean error. Idempotent: an already-occupied slot returns already_occupied without re-occupying.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label of the actor carrying the USmartObjectComponent |
behavior_class |
string | no | Optional behavior definition class (short native name or /Script path); defaults to USmartObjectBehaviorDefinition |
Returns: { actor_label: string, slot_id: string, behavior_definition: string, is_occupied: bool, already_occupied: bool, success: bool }