gameobject-destroy

Destroys a GameObject and its nested children in a Unity Prefab or Scene.

Updated May 27, 2026
One-click install
npx skills add https://github.com/AdielMag/ClashUp --skill gameobject-destroy-adielmag
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gameobject-destroy
Source: https://github.com/AdielMag/ClashUp/tree/main/client/ClashUp.Unity/.claude/skills/gameobject-destroy
Command: npx skills add https://github.com/AdielMag/ClashUp --skill gameobject-destroy-adielmag

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires unity-mcp-cli.

What problem does it solve? Removing GameObjects from a Unity Prefab or active Scene manually through the editor is slow and error-prone, especially when automating scene edits. This Skill destroys a target GameObject and all its nested children programmatically and returns confirmation details of what was removed. ## Core Features & Use Cases - Recursive Destruction: Deletes the target GameObject along with every nested child in one operation. - Flexible Targeting: Resolves the target via instance ID, hierarchy path, name, or asset reference through the gameObjectRef input. - Confirmation Output: Returns the destroyed GameObject's name, hierarchy path, and instance ID so you have a record of the removal. - Use Case: While refactoring a UI prefab, locate an obsolete panel with the gameobject-find skill, then destroy it and its entire child hierarchy in a single call. ## Quick Start Ask the AI to destroy the GameObject named 'OldPanel' in the currently opened Prefab using the gameobject-destroy tool.

Frequently Asked Questions about gameobject-destroy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I delete a GameObject in Unity from the command line?▼

Use the unity-mcp-cli run-tool command with gameobject-destroy, passing a gameObjectRef that identifies the target by instance ID, hierarchy path, or name. The tool destroys the GameObject and all nested children in the opened Prefab or active Scene.

How do I find a GameObject before destroying it in Unity?▼

Use the gameobject-find skill first to locate the target and obtain its instance ID or hierarchy path. Then pass that reference as the gameObjectRef input to gameobject-destroy for precise targeting.

Does destroying a GameObject also remove its children in Unity?▼

Yes, this tool destroys the target GameObject recursively, removing all nested child GameObjects in the hierarchy. It uses Object.DestroyImmediate, which is required for Editor-mode operations.

Why is unity-mcp-cli not found when running the tool?▼

The CLI is either not installed or not on your PATH. Install it globally with npm install -g unity-mcp-cli, or invoke it via npx unity-mcp-cli instead.

What is the difference between Destroy and DestroyImmediate in Unity Editor scripts?▼

DestroyImmediate removes the object immediately and is required for Editor-mode operations outside play mode. Destroy defers removal until after the current frame and is intended for runtime use only.