Component Operations
AddComponent
Attach a component to an entity with optional initial data.
| Parameter | Type | Required | Description |
|---|---|---|---|
component_type | string | Yes | Component type name (e.g., "Transform", "Rigidbody") |
entity_guid | string | No | Target entity GUID (use this OR entity_name) |
entity_name | string | No | Target entity name (for entities created in same transaction) |
data | object | No | Initial component data as JSON |
{
"op": "AddComponent",
"params": {
"entity_name": "Player",
"component_type": "Rigidbody",
"data": {
"mass": 70.0,
"is_kinematic": false
}
}
}
Available Component Types
Core: Transform, CameraComponent
Rendering: MeshComponent, SkinnedMeshComponent, PBRMaterialComponent, UnlitMaterial
Physics: Rigidbody, Collider, CharacterController
Lighting: DirectionalLightComponent, PointLightComponent
Scripting: ScriptComponent
Animation: AnimatorComponent, JointComponent
UI: UICanvasComponent, UIRectTransformComponent, UITextComponent, UIImageComponent, UIButtonComponent, UIPanelComponent, UISliderComponent, UIToggleComponent, UIProgressBarComponent, UIInputFieldComponent, UIDropdownComponent, UILayoutGroupComponent, UILayoutElementComponent
World: TerrainComponent
RemoveComponent
Remove a component from an entity.
| Parameter | Type | Required | Description |
|---|---|---|---|
component_type | string | Yes | Component type name to remove |
entity | string | Yes | Entity GUID |
{
"op": "RemoveComponent",
"params": {
"entity": "a1b2c3d4-...",
"component_type": "Rigidbody"
}
}
SetProperty
Modify a specific property on a component. Uses JSON Pointer syntax for nested paths.
| Parameter | Type | Required | Description |
|---|---|---|---|
component_type | string | Yes | Component type containing the property |
property_path | string | Yes | JSON Pointer to the property (e.g., /position/x, /color) |
value | any | Yes | New value (type must match the property) |
entity_guid | string | No | Target entity GUID (use this OR entity_name) |
entity_name | string | No | Target entity name |
Examples
Set a single axis:
{
"op": "SetProperty",
"params": {
"entity_name": "Player",
"component_type": "Transform",
"property_path": "/position/y",
"value": 10.0
}
}
Set entire position:
{
"op": "SetProperty",
"params": {
"entity_name": "Player",
"component_type": "Transform",
"property_path": "/position",
"value": { "x": 0, "y": 10, "z": -5 }
}
}
Change light color:
{
"op": "SetProperty",
"params": {
"entity_name": "SunLight",
"component_type": "DirectionalLightComponent",
"property_path": "/color",
"value": { "x": 1.0, "y": 0.8, "z": 0.6 }
}
}
Toggle visibility:
{
"op": "SetProperty",
"params": {
"entity_name": "SecretDoor",
"component_type": "MeshComponent",
"property_path": "/visible",
"value": false
}
}