gameobject-destroy

Destroys a GameObject and all nested children in a Unity scene or prefab.

1|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/Fermisloth/Project-Aegis-Adaptive-Outbreak-Containment --skill gameobject-destroy-fermisloth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gameobject-destroy
Source: https://github.com/Fermisloth/Project-Aegis-Adaptive-Outbreak-Containment/tree/main/.agent/skills/gameobject-destroy
Command: npx skills add https://github.com/Fermisloth/Project-Aegis-Adaptive-Outbreak-Containment --skill gameobject-destroy-fermisloth

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires unity-mcp-cli.

What problem does it solve? Removing GameObjects from a Unity scene or prefab manually is slow and error-prone, especially when objects have deep hierarchies of nested children. This Skill deletes a target GameObject and all its descendants recursively through the unity-mcp-cli tool. ## Core Features & Use Cases - Recursive Deletion: Destroys a GameObject along with every nested child GameObject in one operation. - Flexible Targeting: Locates the target by instance ID, hierarchy path, name, asset path, or asset GUID. - Scene and Prefab Support: Works on GameObjects in the active scene or inside an opened prefab. - Use Case: While iterating on a level, you need to remove an obsolete enemy spawner and its entire child hierarchy of waypoints and triggers. Provide the spawner's path and the whole subtree is removed, returning the destroyed name, path, and instance ID for confirmation. ## Quick Start Ask the AI to destroy the GameObject named 'EnemySpawner' in the active scene 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?

Run unity-mcp-cli with the gameobject-destroy tool and pass a gameObjectRef identifying the target by instance ID, hierarchy path, or name. The tool destroys the GameObject and all nested children, returning the destroyed name, path, and instance ID.

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

Use the gameobject-find tool first to locate the target GameObject and obtain its reference details such as instance ID or hierarchy path. Then pass that reference to gameobject-destroy as the gameObjectRef input.

Does gameobject-destroy remove child GameObjects too?

Yes, the tool destroys the target GameObject and all nested GameObjects recursively. This works both in the active scene and inside an opened prefab.

Can I destroy a GameObject inside a prefab asset?

Yes, the tool operates on GameObjects in an opened prefab as well as in the active scene. You can reference the target by instance ID, path, name, asset path, or asset GUID.

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

The CLI must be installed globally with npm install -g unity-mcp-cli, or invoked via npx unity-mcp-cli. Refer to the unity-initial-setup skill for detailed installation instructions.