Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Destroys one or more Components from a Unity GameObject, skipping missing (null) components.
23% 100%+77 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 5 of 22 without it.
3 of 3 safety checks passed
Not used yet
Destroy one or many components from target GameObject. Can't destroy missed components. Use 'gameobject-find' tool to find the target GameObject and 'gameobject-component-get' to get component details first.
gameObjectRef — the host GameObject.destroyComponentRefs — ComponentRefList of components to destroy (matched against the GameObject's components).Iterates go.GetComponents<Component>(), skipping null entries (missing scripts). For each non-null component that matches one of destroyComponentRefs, the tool snapshots a ComponentRef, calls Object.DestroyImmediate, and records the destroyed reference. If no component matches at all, throws with the help text from Error.NotFoundComponents (which includes a preview of all available components on the GameObject).
unity-mcp-cli run-tool gameobject-component-destroy --input '{
"gameObjectRef": "string_value",
"destroyComponentRefs": "string_value"
}'
For complex input (multi-line strings, code), save the JSON to a file and use:
unity-mcp-cli run-tool gameobject-component-destroy --input-file args.jsonOr pipe via stdin (recommended):
unity-mcp-cli run-tool gameobject-component-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.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.