runtime
12 public commands in this category.
apply_force
Apply a force or impulse to an entity during Play mode
Scope:
scene:write. Token cost: 0.- entityId string (required)
- Entity ID to apply force to
- force array (optional)
- Force vector [x, y, z]
- impulse array (optional)
- Impulse vector [x, y, z] (instant)
- torque array (optional)
- Torque vector [x, y, z]
get_mode
Get current engine mode (edit, play, or paused)
Scope:
scene:read. Token cost: 0.pause
Pause play mode — freezes simulation
Scope:
scene:write. Token cost: 0.play
Enter play mode — starts game simulation, snapshots scene state
Scope:
scene:write. Token cost: 0.raycast_query
Cast a ray from origin in direction and return the first entity hit. Results arrive asynchronously via RAYCAST_RESULT event.
Scope:
scene:read. Token cost: 0.- direction array (required)
- Ray direction [x, y, z] (normalized)
- origin array (required)
- Ray origin [x, y, z]
- maxDistance number (optional)
- Maximum ray distance (default 100)
- requestId string (optional)
- Optional request ID for tracking (auto-generated if omitted)
remove_input_binding
Remove an input action binding by name
Scope:
scene:write. Token cost: 0.- actionName string (required)
- Name of the action to remove
- player integer (optional)
- Local-player slot (0 = primary player, the default). Set 1 for a second local player's independent action map; omit for single-player.
resume
Resume play mode from paused state
Scope:
scene:write. Token cost: 0.set_input_binding
Create or update an input action binding (e.g. map 'jump' to Space key)
Scope:
scene:write. Token cost: 0.- actionName string (required)
- Name of the input action (e.g. 'jump', 'move_forward')
- actionType string (required)
- digital = on/off, axis = -1..+1
- deadZone number (optional)
- Dead zone for axis (default 0.1)
- negativeKeys array (optional)
- Negative direction keys for axis actions
- player integer (optional)
- Local-player slot (0 = primary player, the default). Set 1 for a second local player's independent action map; omit for single-player.
- positiveKeys array (optional)
- Positive direction keys for axis actions
- sources array (optional)
- Key codes for digital actions (e.g. ['Space', 'KeyW'])
set_input_preset
Merge a built-in input preset into a player's bindings (additive; the preset's own actions win on name collisions)
Scope:
scene:write. Token cost: 0.- preset string (required)
- Preset name
- player integer (optional)
- Local-player slot (0 = primary player, the default). Set 1 for a second local player's independent action map; omit for single-player.
stop
Stop play mode — restores scene to pre-play state
Scope:
scene:write. Token cost: 0.toggle_physics
Enable or disable physics simulation on an entity
Scope:
scene:write. Token cost: 0.- enabled boolean (required)
- true to enable, false to disable
- entityId string (required)
- Entity ID
update_physics
Set physics properties on an entity (body type, collider, restitution, friction, density, gravity, locked axes)
Scope:
scene:write. Token cost: 0.- entityId string (required)
- Entity ID to configure
- bodyType string (optional)
- Rigid body type
- colliderShape string (optional)
- Collider shape
- density number (optional)
- Mass density
- friction number (optional)
- Surface friction (0-1)
- gravityScale number (optional)
- Gravity multiplier (-10 to 10)
- isSensor boolean (optional)
- If true, detects overlap without blocking
- lockRotationX boolean (optional)
- lockRotationY boolean (optional)
- lockRotationZ boolean (optional)
- lockTranslationX boolean (optional)
- lockTranslationY boolean (optional)
- lockTranslationZ boolean (optional)
- restitution number (optional)
- Bounciness (0-1)