Unity Smart Skills
Guardrails
Mode: Full-Auto required
DO NOT (common hallucinations):
- / do not exist → smart skills are query/layout tools, not creation tools
- does not exist → use for SQL-like scene queries
- does not exist → use or
Routing:
- For creating objects → use module
- For simple object search → use or
- For complex scene queries (SQL-like) → (this module)
Skills
smart_scene_query
Find objects based on component property values (SQL-like).
| Parameter | Type | Required | Default | Description |
|---|
| string | Yes | - | Component type (Light, Camera, MeshRenderer) |
| string | Yes | - | Property to query (intensity, enabled, etc.) |
| string | No | "==" | ==, !=, >, <, >=, <=, contains |
| string | No | null | Value to compare |
| int | No | 50 | Max results |
| string | No | null | Unsupported shorthand; if provided alone returns a guidance error |
Example:
python
# Find all lights with intensity > 2
call_skill("smart_scene_query", componentName="Light", propertyName="intensity", op=">", value="2")
smart_scene_layout
Organize selected objects into a layout.
| Parameter | Type | Required | Default | Description |
|---|
| string | No | "Linear" | Linear, Grid, Circle, Arc |
| string | No | "X" | X, Y, Z, -X, -Y, -Z |
| float | No | 2.0 | Space between items (or radius) |
| int | No | 3 | For Grid layout |
| float | No | 180 | For Arc layout (degrees) |
| bool | No | false | Rotate to face center |
Example:
python
# Arrange selected objects in a circle
call_skill("smart_scene_layout", layoutType="Circle", spacing=5)
smart_reference_bind
Auto-fill a List/Array field with matching objects.
| Parameter | Type | Required | Default | Description |
|---|
| string | Yes | - | Target GameObject |
| string | Yes | - | Component on target |
| string | Yes | - | Field to fill |
| string | No | null | Find by tag |
| string | No | null | Find by name contains |
| bool | No | false | Append instead of replace |
Example:
python
# Fill GameManager.spawns with all SpawnPoint tagged objects
call_skill("smart_reference_bind", targetName="GameManager", componentName="GameController", fieldName="spawns", sourceTag="SpawnPoint")
smart_scene_query_spatial
Find objects within a sphere/box region, optionally filtered by component.
| Parameter | Type | Required | Default | Description |
|---|
| float | Yes | - | Center X coordinate |
| float | Yes | - | Center Y coordinate |
| float | Yes | - | Center Z coordinate |
| float | No | 10 | Search sphere radius |
| string | No | null | Only include objects with this component |
| int | No | 50 | Max results |
Returns: { success, count, center, radius, results }
Raycast selected objects downward to align them to the ground. Requires objects selected in Hierarchy first.
| Parameter | Type | Required | Default | Description |
|---|
| float | No | 100 | Maximum raycast distance |
| bool | No | false | Align rotation to surface normal |
Returns: { success, aligned, total }
Evenly distribute selected objects between first and last positions. Requires at least 3 objects selected in Hierarchy first.
| Parameter | Type | Required | Default | Description |
|---|
| string | No | "X" | X, Y, Z, -X, -Y, -Z |
Returns: { success, distributed, axis }
Snap selected objects to a grid.
| Parameter | Type | Required | Default | Description |
|---|
| float | No | 1 | Grid cell size |
Returns: { success, snapped, gridSize }
smart_randomize_transform
Randomize position/rotation/scale of selected objects within ranges.
| Parameter | Type | Required | Default | Description |
|---|
| float | No | 0 | Position randomization range |
| float | No | 0 | Rotation randomization range (degrees) |
| float | No | 1 | Minimum uniform scale |
| float | No | 1 | Maximum uniform scale |
Replace selected objects with a prefab (preserving transforms). Requires objects selected in Hierarchy first.
| Parameter | Type | Required | Default | Description |
|---|
| string | Yes | - | Asset path to the replacement prefab |
Returns: { success, replaced, prefab }
smart_select_by_component
Select all objects that have a specific component.
| Parameter | Type | Required | Default | Description |
|---|
| string | Yes | - | Component type name to search for |
Returns: { success, selected, component }
Exact Signatures
Exact names, parameters, defaults, and returns are defined by
or
unity_skills.get_skill_schema()
, not by this file.