Creates a 3D mesh from a 2D polygon outline. Perfect for: - Floor plans and room layouts - Custom terrain patches - Architectural elements (walls, platforms) - Any shape that can be defined by a 2D outline The polygon is defined by an array of 2D points (x,z coordinates) that form the outline. The shape is then extruded upward by the specified height. 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
unity-mcp-cli run-tool probuilder-create-poly-shape --input '{
"points": "string_value",
"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
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.
| Name | Type | Required | Description |
|---|---|---|---|
points | any | 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 | any | No | Parent GameObject reference. If not provided, the shape will be created at the root of the scene. |
position | any | No | Position of the shape in world or local space. |
rotation | any | No | Rotation of the shape in euler angles (degrees). |
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. |
{
"type": "object",
"properties": {
"points": {
"$ref": "#/$defs/System.Single[][]"
},
"height": {
"type": "number"
},
"name": {
"type": "string"
},
"parentGameObjectRef": {
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Runtime.Data.GameObjectRef"
},
"position": {
"$ref": "#/$defs/UnityEngine.Vector3"
},
"rotation": {
"$ref": "#/$defs/UnityEngine.Vector3"
},
"flipNormals": {
"type": "boolean"
},
"isLocalSpace": {
"type": "boolean"
}
},
"$defs": {
"System.Single[]": {
"type": "array",
"items": {
"type": "number"
}
},
"System.Single[][]": {
"type": "array",
"items": {
"$ref": "#/$defs/System.Single[]"
}
},
"System.Type": {
"type": "string"
},
"com.IvanMurzak.Unity.MCP.Runtime.Data.GameObjectRef": {
"type": "object",
"properties": {
"instanceID": {
"type": "integer",
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
},
"path": {
"type": "string",
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
},
"name": {
"type": "string",
"description": "Name of a GameObject in hierarchy. Priority: 3."
},
"assetType": {
"$ref": "#/$defs/System.Type",
"description": "Type of the asset."
},
"assetPath": {
"type": "string",
"description": "Path to the asset within the project. Starts with 'Assets/'"
},
"assetGuid": {
"type": "string",
"description": "Unique identifier for the asset."
}
},
"required": [
"instanceID"
],
"description": "Find GameObject in opened Prefab or in the active Scene."
},
"UnityEngine.Vector3": {
"type": "object",
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"x",
"y",
"z"
],
"additionalProperties": false
}
},
"required": [
"points"
]
}
{
"type": "object",
"properties": {
"result": {
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder+CreatePolyShapeResponse"
}
},
"$defs": {
"System.Collections.Generic.List<com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder+PointInfo>": {
"type": "array",
"items": {
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder+PointInfo"
}
},
"com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder+PointInfo": {
"type": "object",
"properties": {
"index": {
"type": "integer"
},
"x": {
"type": "number"
},
"z": {
"type": "number"
}
},
"required": [
"index",
"x",
"z"
]
},
"com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder+CreatePolyShapeResponse": {
"type": "object",
"properties": {
"gameObjectName": {
"type": "string"
},
"instanceId": {
"type": "integer"
},
"position": {
"type": "string"
},
"rotation": {
"type": "string"
},
"pointCount": {
"type": "integer"
},
"height": {
"type": "number"
},
"flipNormals": {
"type": "boolean"
},
"boundsSize": {
"type": "string"
},
"faceCount": {
"type": "integer"
},
"vertexCount": {
"type": "integer"
},
"edgeCount": {
"type": "integer"
},
"inputPoints": {
"$ref": "#/$defs/System.Collections.Generic.List<com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder+PointInfo>"
}
},
"required": [
"instanceId",
"pointCount",
"height",
"flipNormals",
"faceCount",
"vertexCount",
"edgeCount"
]
}
},
"required": [
"result"
]
}