gameobject-destroy

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

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/lunafish/Game00 --skill gameobject-destroy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gameobject-destroy
Source: https://github.com/lunafish/Game00/tree/main/SKILLS/gameobject-destroy
Command: npx skills add https://github.com/lunafish/Game00 --skill gameobject-destroy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill allows for the recursive deletion of GameObjects and their children within a Unity scene or prefab, streamlining asset management and cleanup.

Core Features & Use Cases

  • Recursive Destruction: Deletes a specified GameObject and all of its child GameObjects.
  • Scene/Prefab Support: Operates on GameObjects currently open in a Unity Scene or Prefab.
  • Use Case: Clean up complex prefabs by removing unwanted nested elements or clear out temporary objects from a scene after a test.

Quick Start

Destroy the GameObject named 'OldCharacter' in the active scene.

Frequently Asked Questions about gameobject-destroy

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

FAQPage Schema
How do I recursively destroy a GameObject and all its children in Unity?▼

You can recursively destroy a GameObject in Unity by specifying its instance ID, path, name, asset path, or asset GUID. This Skill removes the target object and all of its nested child GameObjects from an opened Prefab or active Scene.

Can I use this to clean up nested elements inside a Unity Prefab?▼

Yes, you can use this to clean up nested elements inside a Unity Prefab. It operates on GameObjects currently open in a Unity Scene or Prefab, allowing you to recursively remove unwanted child objects from complex prefabs.

What is the best way to delete temporary objects from a Unity scene after testing?▼

The best way to delete temporary objects from a Unity scene after testing is using recursive destruction. By targeting the parent GameObject, this Skill clears out the object and all its nested children, streamlining scene hierarchy cleanup.

Does destroying GameObjects require a specific reference type to identify the target?▼

Destroying GameObjects requires a valid GameObject reference to identify the target. You can provide this reference using the object's instance ID, hierarchy path, name, asset path, or asset GUID to ensure accurate recursive deletion.

Are there limitations when removing unwanted GameObjects from an active Unity scene?▼

A limitation when removing GameObjects is that the target must reside within an opened Unity Prefab or an active Scene. If a valid GameObject reference is not provided, the recursive cleanup of the scene hierarchy cannot proceed.