gameobject-destroy

Deletes a specified GameObject and all nested children in Unity Scenes or Prefabs.

3.8k|349|Updated Apr 2, 2025
One-click install
npx skills add https://github.com/IvanMurzak/Unity-MCP --skill gameobject-destroy-ivanmurzak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gameobject-destroy
Source: https://github.com/IvanMurzak/Unity-MCP/tree/main/Unity-MCP-Plugin/.claude/skills/gameobject-destroy
Command: npx skills add https://github.com/IvanMurzak/Unity-MCP --skill gameobject-destroy-ivanmurzak

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Deleting a target GameObject and all of its nested children in a Unity opened Prefab or active Scene used to be error-prone and tedious.

Core Features & Use Cases

  • Recursively destroy a GameObject and all nested children within an opened Prefab or the active Scene.
  • Use the gameobject-find tool to locate the target by instanceID, path, or name before destruction.
  • Returns structured results including the DestroyedName, DestroyedPath, and DestroyedInstanceId to confirm what was removed.

Quick Start

Find the target GameObject with gameobject-find and run the tool to perform the destruction.

Frequently Asked Questions about gameobject-destroy

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

FAQPage Schema
How do I destroy a GameObject and all its nested children in a Unity scene?

Destroying a GameObject and all nested children in a Unity scene requires a valid gameObjectRef input. The tool locates the target by instanceID, path, or name using gameobject-find before performing recursive destruction.

What is the best way to delete nested objects recursively within an opened Unity prefab?

Deleting nested objects recursively within an opened Unity prefab is handled by targeting the parent GameObject. The operation returns structured results containing DestroyedName, DestroyedPath, and DestroyedInstanceId to confirm what was removed.

Can I locate a Unity GameObject by instanceID before destroying it?

Yes, you can locate a Unity GameObject by instanceID before destroying it. The tool supports locating targets via instanceID, path, or name using gameobject-find, enabling precise destruction operations in Unity projects.

How do I get started with removing a specific GameObject from my Unity hierarchy?

To remove a specific GameObject from your Unity hierarchy, find the target with the gameobject-find tool first. Then run the destruction tool with a valid gameObjectRef input to perform the removal.

Does the tool confirm what was removed after destroying a GameObject in Unity?

Yes, the tool confirms what was removed after destroying a GameObject in Unity. It yields a structured result containing DestroyedName, DestroyedPath, and DestroyedInstanceId to verify the exact object and its previous location.