Play Session
Play Session: Spawn, change and check actors while your game runs in Play In Editor. Unreal Engine 5 command reference with parameters and examples.
Play Session: Spawn, change and check actors while your game runs in Play In Editor. Unreal Engine 5 command reference with parameters and examples.
7 commands. Each shows its parameters and an example, and has a copyable deep link, so you (or an AI agent) can jump straight to one.
spawn_runtime_actorsSpawn 1 to 1000 actors or Blueprints into a running play session, near a player or at a location
| Parameter | Type | Required | Description |
|---|---|---|---|
| class | string | Yes | Actor class: a Blueprint path (/Game/AI/BP_Enemy), a bare Blueprint name, a class path, or a native class name |
| count | int | No | How many, 1 to 1000 |
| world | string | No | |
| location | json | No | Center of the group as [x,y,z] or "x,y,z"; omit to spawn in front of a player |
| rotation | json | No | Rotation of every actor as [pitch,yaw,roll]; omit to face the player (or zero with --location) |
| player | int | No | Without --location: the player controller index to spawn near |
| distance | float | No | Without --location: how far in front of the player the group's center is |
| pattern | string | No | grid, ring, random or point (default point for one actor, grid for more) |
| spacing | float | No | Space between actors in a grid or ring |
| radius | float | No | Radius of a random pattern, and the smallest ring radius |
| on_navmesh | bool | No | Put every point on the navigation mesh |
| snap_to_ground | bool | No | Stand each actor on static ground |
| properties | json | No | Property path to value, set before the construction script and BeginPlay, e.g. {"Health":50,"CharacterMovement.MaxWalkSpeed":300} |
| replicate | bool | No | Server only: turn actor replication on (or off with =false) for these actors, whatever the class says |
| replicate_movement | bool | No | Server only: turn movement replication on or off for these actors |
| ai | bool | No | Pawns on the server get an AI controller by default; =false leaves them without one |
| ai_controller | string | No | AI controller class instead of the pawn's AIControllerClass |
| behavior_tree | string | No | Behavior Tree asset each AI controller runs |
| tags | stringlist | No | Extra actor tags |
| batch | string | No | Name for this group, used by the other runtime commands (default <Class>_<n>); an existing name adds to that batch |
| collision | string | No | When a spot is blocked: adjust (default; move it free), always (spawn in place) or skip_if_blocked |
cfa spawn_runtime_actors --class /Game/AI/BP_Enemy --count 100 --on-navmesh --behavior-tree /Game/AI/BT_Enemy
cfa spawn_runtime_actors --class BP_Pickup --count 12 --pattern ring --radius 600 --replicate
cfa spawn_runtime_actors --class /Game/BP_Crate --location "[0,0,200]" --properties '{"Health":50}'
cfa spawn_runtime_actors --class BP_Marker --world client1list_runtime_actorsCount and list play-session actors per world, server and each client
| Parameter | Type | Required | Description |
|---|---|---|---|
| world | string | No | server, client1..., all_clients, instance:N or all (default) |
| batch | string | No | Only this batch |
| class | string | No | Only classes whose name contains this text |
| filter | string | No | Only actor names that contain this text |
| tag | string | No | Only actors with this tag |
| spawned_only | bool | No | Only actors the runtime commands spawned; false lists every actor |
| max_results | int | No | Most rows over all worlds; counts stay complete |
cfa list_runtime_actors --batch enemies
cfa list_runtime_actors --world client1 --batch enemies --max-results 5
cfa list_runtime_actors --world server --spawned-only=false --class Characterget_runtime_actorOne play-session actor: role, replication, transform, AI, client copies, variables
| Parameter | Type | Required | Description |
|---|---|---|---|
| actor | string | Yes | Actor name in that world, from list_runtime_actors |
| world | string | No | |
| component | string | No | Read a component of the actor instead, by name |
| property_path | string | No | Return only this property's value |
| filter | string | No | Properties whose name contains this text, from every class of the actor |
| max_results | int | No | Most properties listed |
cfa get_runtime_actor --actor BP_Enemy_C_3
cfa get_runtime_actor --actor BP_Enemy_C_3 --world client1 --property-path Health
cfa get_runtime_actor --actor BP_Enemy_C_3 --component CharacterMovement --filter Speedset_runtime_actor_propertiesChange properties of running actors; replicated ones reach every client
| Parameter | Type | Required | Description |
|---|---|---|---|
| properties | json | Yes | Property path to value, e.g. {"Health":25,"Stats.Armor":3} |
| actor | string | No | One actor by name; give actor or batch |
| batch | string | No | Every actor of a batch in that world |
| world | string | No | |
| component | string | No | Write to a component of each actor instead, by name |
cfa set_runtime_actor_properties --batch enemies --properties '{"Health":25}'
cfa set_runtime_actor_properties --actor BP_Door_C_0 --properties '{"bIsOpen":true}'
cfa set_runtime_actor_properties --batch enemies --component CharacterMovement --properties '{"MaxWalkSpeed":150}'call_runtime_functionCall a function, event or RPC on running actors with named arguments
| Parameter | Type | Required | Description |
|---|---|---|---|
| function | string | Yes | Function, event or RPC name |
| args | json | No | Argument name to value, e.g. {"Amount":5} |
| actor | string | No | One actor by name; give actor or batch |
| batch | string | No | Every actor of a batch in that world |
| world | string | No | |
| component | string | No | Call it on a component of each actor instead, by name |
cfa call_runtime_function --actor BP_Enemy_C_3 --function TakeHit --args '{"Damage":10}'
cfa call_runtime_function --batch enemies --function K2_SetActorLocation --args '{"NewLocation":[0,0,300]}'
cfa call_runtime_function --actor BP_Door_C_0 --function MulticastOpendestroy_runtime_actorsDestroy an actor, a batch, or every spawned actor of a play world
| Parameter | Type | Required | Description |
|---|---|---|---|
| actor | string | No | One actor by name |
| batch | string | No | Every actor of a batch |
| all_spawned | bool | No | Every actor the runtime commands spawned in that world |
| world | string | No |
cfa destroy_runtime_actors --batch enemies
cfa destroy_runtime_actors --actor BP_Enemy_C_3
cfa destroy_runtime_actors --all-spawnedvalidate_runtime_actorsCheck a batch with a verdict: alive, AI running, a matching copy on every client
| Parameter | Type | Required | Description |
|---|---|---|---|
| actor | string | No | One actor by name; give actor or batch |
| batch | string | No | Every actor of a batch |
| world | string | No |
cfa validate_runtime_actors --batch enemies
cfa validate_runtime_actors --actor BP_Door_C_0