You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| game config |`GameConfigLlmTool`|`GameConfigPolicy.CreateLlmTool(store, roleId)`| Per-role config slots. |
33
-
|`world_command`|`WorldLlmTool`|`ICoreAiWorldCommandExecutor`| Native world edits. `spawn` accepts registered prefab keys or built-in primitives (`cube`, `sphere`, `cylinder`, `capsule`, `plane`, `empty`) when `AllowWorldPrimitives` is on; spawn can ALSO set rotation (`fx/fy/fz` degrees) and uniform `scale`in one call. Models can also move, rotate, scale, and parent objects. Models usually edit the world via Lua `coreai_world_*` instead, so this is optional. |
33
+
|`world_command`|`WorldLlmTool`|`ICoreAiWorldCommandExecutor`| Native world edits. `spawn` accepts registered prefab keys or built-in primitives (`cube`, `sphere`, `cylinder`, `capsule`, `plane`, `empty`) when `AllowWorldPrimitives` is on; spawn can set transform and parent in one call. Parented coordinates are local by default; `worldPositionStays=true` preserves world space. Models usually edit the world via Lua `coreai_world_*` instead, so this is optional. |
34
34
|`component_command`|`ComponentLlmTool`|`ICoreAiComponentCommandExecutor`| Add/remove/configure supported Unity components through a curated catalog, no reflection. |
35
35
| scene query |`SceneLlmTool`| scene |`unity_*`-style scene inspection as a native tool (alternative to Full-tier Lua). |
36
36
|`capture_camera`|`CameraLlmTool`| a `Camera` + a **vision-capable model**| Renders a camera to JPEG. Attach the captured `DataContent` (`CameraLlmTool.CaptureCameraImageContent`) to a user message; `MeaiOpenAiChatClient` serializes it to OpenAI `image_url`. See **Vision / multimodal** below for the host send path and autonomous-tool wiring. |
37
37
38
38
### World and component commands
39
39
40
-
`world_command`now works without a prefab registry for simple spawn requests when `ICoreAISettings.AllowWorldPrimitives` is enabled (default). `prefabKey` may be a registered prefab key or one of the built-in primitive keys: `cube`, `sphere`, `cylinder`, `capsule`, `plane`, `empty`. During spawn you can ALSO set rotation (fx/fy/fz degrees) and uniform scale in one call, or use separate rotate/set_scale actions later. The action list includes moving, rotating, scaling, and parenting objects.
40
+
`world_command` works without a prefab registry for simple spawn requests when `ICoreAISettings.AllowWorldPrimitives` is enabled (default). `prefabKey` may be a registered prefab key or one of the built-in primitive keys: `cube`, `sphere`, `cylinder`, `capsule`, `plane`, `empty`. During spawn, position, rotation, scale and parent can be supplied in one call. With a parent, coordinates are local by default (`worldPositionStays=false`); set it to `true` to preserve a world transform. For compound objects, create an `empty` root first and parent the named parts beneath it instead of leaving a flat scene hierarchy.
41
41
42
42
`component_command` is separate from `world_command` and uses a curated catalog instead of reflection. Actions are `add`, `remove`, `set`, and `list_components`. Supported `componentType` values are `rigidbody`, `rigidbody2d`, `boxcollider`, `spherecollider`, `capsulecollider`, `meshcollider`, `light`, `audiosource`, `camera`, `linerenderer`, `trailrenderer`, `textmesh`, `meshrenderer`, and `particlesystem`. For `set`, pass `propertyName` plus the matching value field: `floatValue`, `boolValue` (`0` / `1`), `stringValue`, or `x` / `y` / `z`.
Copy file name to clipboardExpand all lines: Assets/CoreAiUnity/Docs/JSON_COMMAND_FORMAT.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,7 +165,14 @@ unsupported failure when `SecureLuaEnvironment.IsSupported` is `false`.
165
165
}
166
166
```
167
167
168
-
`prefabKey` and `targetName` are required. Position, rotation (`fx/fy/fz`), uniform `scale`, per-axis `scaleX/scaleY/scaleZ`, and parent (`stringValue`) are optional. `scale` is a uniform fallback; use per-axis scale for meter-accurate dimensions.
168
+
`prefabKey` and `targetName` are required. Position, rotation (`fx/fy/fz`), uniform `scale`, per-axis
169
+
`scaleX/scaleY/scaleZ`, parent (`stringValue`), and `worldPositionStays` are optional. When a parent is set,
170
+
coordinates are local by default (`worldPositionStays: false`); `true` preserves world space. Without a
171
+
parent, local and world coordinates are identical. `scale` is a uniform fallback; use per-axis scale for
172
+
meter-accurate dimensions.
173
+
174
+
For compound objects, create a named `empty` root first and parent related pieces beneath it instead of
175
+
leaving every piece at scene root.
169
176
170
177
`prefabKey` may be a registered prefab key or a built-in primitive key (`cube`, `sphere`, `cylinder`, `capsule`, `plane`, `empty`) when `AllowWorldPrimitives` is enabled. Registered prefabs take precedence.
|`stringValue`| string | Scene name, search query, parent name, HTML colour, or clip key depending on action. |
232
+
|`worldPositionStays`| bool | Parenting policy for `spawn`/`change`. Default `false`: coordinates are local to the named parent. `true`: preserve world transform. |
232
233
|`animationName`| string | Animation name. |
233
234
|`textToDisplay`| string | Text to display. |
234
235
|`volume`| float | Audio volume. |
235
236
236
237
**Examples:**
237
238
238
239
```json
239
-
// Spawn with optional position, rotation, non-uniform scale, and parent
@@ -256,6 +257,11 @@ Since **v1.5.0**, `ToolExecutionPolicy`, `SmartToolCallingChatClient`, `LoggingL
256
257
```
257
258
258
259
**When to use:** Creator / Designer AI that dynamically drives the world. For scene inspection and instance-level scene operations, use `scene_tool`; it is separate from `world_command`.
260
+
261
+
For compound spawned objects, create a named `empty` root first and parent related pieces beneath it. Use
262
+
local coordinates (the default) for parts such as posts, roofs and props; use `worldPositionStays: true`
263
+
only when attaching an already world-positioned object. This keeps the hierarchy meaningful and lets the
264
+
whole object move as one unit.
259
265
### 5. Component command tool
260
266
261
267
**Purpose:** Add, remove, configure, and list Unity components on existing GameObjects through a curated catalog. This tool does not use reflection.
0 commit comments