Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Destroys a GameObject and its nested children in the open Prefab or active Scene, returning the destroyed name, path, and instance ID.
Use this skill ↓50% 95%+45 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 11 of 22 without it.
3 of 3 safety checks passed
Not used yet
Destroy GameObject and all nested GameObjects recursively in opened Prefab or in a Scene. Use 'gameobject-find' tool to find the target GameObject first.
Validates the gameObjectRef, resolves it on the main thread, then calls Object.DestroyImmediate (the immediate variant is required for Editor-mode operations). Returns a DestroyGameObjectResult containing DestroyedName, DestroyedPath, and DestroyedInstanceId so the caller has a record of what was removed.
unity-mcp-cli run-tool gameobject-destroy --input '{
"gameObjectRef": "string_value"
}'
For complex input (multi-line strings, code), save the JSON to a file and use:
unity-mcp-cli run-tool gameobject-destroy --input-file args.jsonOr pipe via stdin (recommended):
unity-mcp-cli run-tool gameobject-destroy --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 |
|---|---|---|---|
gameObjectRef | any | Yes | Find GameObject in opened Prefab or in the active Scene. |
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.