Add ANY component LIVE to the user's open R3 editor
r3_editor_add_componentThe same tool as r3_component_add (this is its older name): add one component of ANY registered type — a collider, a rigid body, a joint, a light, a material, a geometry … — with its values and references set before it is created, kept at once in the project's live copy: every R3 tab with the project open shows it now, no editor needed and nothing to save. Use r3_editor_create for a ready-made object.
type is the short type name, e.g. "ColliderCuboid" (an unknown type is refused with the list). values take r3_component_set's shapes: a plain value {"friction": 0.2}; a value component as the keys to set {"halfExtents": {"x": 2, "y": 0.5, "z": 1}}; a reference as the target's entityRef or id {"rigidBody": "rigidbody_dynamic_1"} — a component of THIS project, of a type the slot accepts. Example — swap a rigid body's collider: add a ColliderCuboid with {"rigidBody": …, "halfExtents": …}, then r3_editor_delete the old collider (mode "one").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | The component type, e.g. "ColliderCuboid", "RigidBodyFixed", "LightPoint". | |
| values | No | Its values, e.g. {"rigidBody": "rigidbody_dynamic_1", "halfExtents": {"x": 2}, "friction": 0.2}. | |
| projectId | Yes | The project (r3_project_list). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seq | No | ||
| live | Yes | ||
| type | Yes | ||
| saved | Yes | ||
| answer | Yes | This answer in words: what was done, what R3 measured, decided or refused, and what to do next. The same text as the result's text block. Read it: the fields beside it are the data, this is the guidance. | |
| editor | Yes | ||
| created | Yes | ||
| entityRef | Yes | ||
| projectId | Yes | ||
| componentId | Yes |