3.9 KiB
3.9 KiB
| name | description | metadata | ||
|---|---|---|---|---|
| probuilder-create-poly-shape | Create a 3D `ProBuilderMesh` from a 2D polygon outline (x,z points) extruded upward by `height`. Perfect for floor plans, room layouts, terrain patches, walls, platforms — any shape definable by a 2D outline. Requires ≥3 points. |
|
Create a ProBuilder shape from polygon points
Create a 3D ProBuilderMesh from a 2D polygon outline (x,z points) extruded upward by height. Perfect for:
- Floor plans and room layouts.
- Custom terrain patches.
- Architectural elements (walls, platforms).
- Any shape that can be defined by a 2D outline.
Inputs
points— array of 2D points as[x, z]. Minimum 3 points; should be in clockwise or counter-clockwise order.height— extrusion height upward (Y axis). Default1.name— optional GameObject name.parentGameObjectRef— optional parent; root of the scene when omitted.position,rotation— optionalVector3transform values (rotation in euler degrees).flipNormals— whentrue, flip the resulting face normals so the shape points inward.isLocalSpace— whentrue, position/rotation are interpreted in the parent's local space.
Examples
- Rectangle:
points=[[0,0], [4,0], [4,3], [0,3]],height=2.5. - L-shape:
points=[[0,0], [3,0], [3,2], [1,2], [1,3], [0,3]],height=3. - Triangle:
points=[[0,0], [2,0], [1,1.7]],height=1.
How to Call
unity-mcp-cli run-tool probuilder-create-poly-shape --input '{
"points": [],
"height": 0,
"name": "string_value",
"parentGameObjectRef": "string_value",
"position": "string_value",
"rotation": "string_value",
"flipNormals": false,
"isLocalSpace": false
}'
For complex input (multi-line strings, code), save the JSON to a file and use:
unity-mcp-cli run-tool probuilder-create-poly-shape --input-file args.jsonOr pipe via stdin (recommended):
unity-mcp-cli run-tool probuilder-create-poly-shape --input-file - <<'EOF' {"param": "value"} EOF
Troubleshooting
If unity-mcp-cli is not found, either install it globally (npm install -g unity-mcp-cli) or use npx unity-mcp-cli instead.
Read the /unity-initial-setup skill for detailed installation instructions.
Input
| Name | Type | Required | Description |
|---|---|---|---|
points |
array |
Yes | 2D polygon points as [x,z] coordinates. Minimum 3 points. Points should be in clockwise or counter-clockwise order. Example: 0,0], [4,0], [4,3], [0,3 creates a 4x3 rectangle. |
height |
number |
No | Height to extrude the polygon upward. Default is 1. |
name |
string |
No | Name of the new GameObject. |
parentGameObjectRef |
string |
No | Parent GameObject reference. If not provided, the shape will be created at the root of the scene. RQL: GameObjectRef |
position |
string |
No | Position of the shape in world or local space. RQL: Vector3 |
rotation |
string |
No | Rotation of the shape in euler angles (degrees). RQL: Vector3 |
flipNormals |
boolean |
No | If true, flip the normals so the faces point inward instead of outward. |
isLocalSpace |
boolean |
No | If true, position/rotation are in local space relative to parent. |
Input JSON Schema
{
"type": "object",
"properties": {
"points": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
}
},
"height": {
"type": "number"
},
"name": {
"type": "string"
},
"parentGameObjectRef": {
"type": "string"
},
"position": {
"type": "string"
},
"rotation": {
"type": "string"
},
"flipNormals": {
"type": "boolean"
},
"isLocalSpace": {
"type": "boolean"
}
},
"required": [
"points"
]
}
Output
This tool does not return structured output.