GameplayBehavior¶
8 tools. Back to the index.
create_behavior_config¶
Additive.
Create a UGameplayBehaviorConfig asset at package_path/config_name, or load the one already there, set its protected BehaviorClass by reflection when behavior_class resolves, then save it. An unresolved behavior_class is ignored without error, so check behavior_class in the reply; created tells new from existing.
| Parameter | Type | Required | Description |
|---|---|---|---|
config_name |
string | yes | Asset name of the config, e.g. "BC_Patrol" |
package_path |
string | no | Destination /Game folder (default /Game/MCP). |
behavior_class |
string | no | Full path of a loaded UGameplayBehavior subclass, e.g. "/Script/GameplayBehaviorsModule.GameplayBehavior_AnimationBased"; a short name never resolves, and a miss is ignored |
Returns: { config_path: string, config_name: string, behavior_class: string, created: bool, saved: bool }
end_behavior_on_actor¶
Destructive.
Stop a UGameplayBehavior running on a Pawn in the editor world.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Label of the Pawn actor in the editor world. |
behavior_class |
string | no | Optional UGameplayBehavior subclass to stop; defaults to UGameplayBehavior (stop all). |
Returns: { actor_label: string, behavior_class: string, ended: bool }
get_behavior_config_info¶
Read-only.
Read the protected BehaviorClass of a UGameplayBehaviorConfig asset by reflection: behavior_class (class name), behavior_class_path and has_behavior_class. Read-only; set it with set_behavior_class, or list every config with list_behavior_configs.
| Parameter | Type | Required | Description |
|---|---|---|---|
config_path |
string | yes | Path of the UGameplayBehaviorConfig asset, e.g. "/Game/MCP/BC_Patrol" |
Returns: { config_path: string, behavior_class: string, behavior_class_path: string, has_behavior_class: bool }
get_behavior_subsystem_info¶
Read-only.
Report whether the editor world has a UGameplayBehaviorSubsystem (UGameplayBehaviorSubsystem::GetCurrent): world_name, subsystem_available and, when it exists, subsystem_class. Read-only, no parameters; trigger_behavior_on_actor and end_behavior_on_actor fail without it.
No parameters.
Returns: { world_name: string, subsystem_available: bool, subsystem_class: string }
list_behavior_configs¶
Read-only.
Enumerate every UGameplayBehaviorConfig asset under a package path via AssetRegistry.
| Parameter | Type | Required | Description |
|---|---|---|---|
package_path |
string | no | Optional path filter (default "/Game"). Pass "" to scan all. |
Returns: { package_path, total, configs:[{ config_path, config_name, behavior_class }] }
remove_behavior_config¶
Destructive, idempotent.
Destroy a UGameplayBehaviorConfig data asset (mirror of create_behavior_config). Typed-delete: it loads the asset and REFUSES to delete it if it is not a UGameplayBehaviorConfig, so it cannot wipe the wrong asset the way the generic delete_asset can. Idempotent on missing assets.
| Parameter | Type | Required | Description |
|---|---|---|---|
config_path |
string | yes | Full /Game/... asset path of the config. |
Returns: { config_path, deleted, already_existed, asset_class?, note? }
set_behavior_class¶
Destructive, idempotent.
Set the BehaviorClass of a UGameplayBehaviorConfig (via reflection; the field is protected in 5.7).
| Parameter | Type | Required | Description |
|---|---|---|---|
config_path |
string | yes | Content path of the UGameplayBehaviorConfig. |
behavior_class |
string | yes | UGameplayBehavior subclass name (with or without "U" prefix). |
Returns: { config_path: string, behavior_class: string, set: bool, saved: bool }
trigger_behavior_on_actor¶
Destructive.
Start the behavior of a UGameplayBehaviorConfig on a Pawn found by label in the editor world: the config supplies its UGameplayBehavior, whose Trigger runs on the pawn, and the world UGameplayBehaviorSubsystem tracks it until it ends or end_behavior_on_actor stops it. triggered=false means the behavior refused. Runtime only: nothing is saved or undoable. A config without BehaviorClass (see set_behavior_class), no subsystem in the editor world (see get_behavior_subsystem_info), a missing actor or a non-Pawn is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
config_path |
string | yes | Content path of the UGameplayBehaviorConfig. |
actor_label |
string | yes | Label of the Pawn actor in the editor world to receive the behavior. |
Returns: { config_path: string, actor_label: string, behavior_class: string, triggered: bool }