gameobject-destroy

Destroy a specified Unity GameObject and its nested children.

Updated Aug 26, 2025
One-click install
npx skills add https://github.com/infotechsrealm/PanicAtThePond --skill gameobject-destroy-infotechsrealm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gameobject-destroy
Source: https://github.com/infotechsrealm/PanicAtThePond/tree/main/.claude/skills/gameobject-destroy
Command: npx skills add https://github.com/infotechsrealm/PanicAtThePond --skill gameobject-destroy-infotechsrealm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of manually deleting GameObjects in Unity, providing a streamlined way to destroy objects programmatically, including nested children.

Core Features & Use Cases

  • Destroy GameObjects: Remove GameObjects and their nested children from a scene or prefab.
  • Confirmation Details: Returns the name, path, and instance ID of the destroyed GameObject for tracking.
  • Use Case: Efficiently remove unnecessary GameObjects during game development to optimize performance.

Quick Start

To destroy a GameObject, first use 'gameobject-find' to locate it, then run 'gameobject-destroy --input '{"gameObjectRef": "targetGameObjectPath"}' to destroy it.

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 its children in Unity?

To destroy a GameObject in Unity, the Skill uses Unity's DestroyImmediate method to remove the target and its nested children, returning the name, path, and instance ID for tracking. It requires locating the target first.

What is the best way to clean up scene clutter during Unity game development?

Cleaning up scene clutter is handled by programmatically destroying unnecessary GameObjects and their nested children. This optimizes performance by efficiently removing objects during runtime using the DestroyImmediate method.

How do I use DestroyImmediate to remove a GameObject from a Unity scene?

Using DestroyImmediate involves passing a located GameObject reference to the Skill. You must first locate the target GameObject, then execute the destroy command with the input JSON containing the gameObjectRef path.

Does this Unity GameObject destruction method require a specific object reference format?

Yes, the destruction method requires a gameObjectRef input containing the target GameObject's path. It assumes the 'gameobject-find' Skill has already been used to locate the target object within the Unity scene.

Can I track which GameObjects were destroyed in Unity?

Tracking destroyed GameObjects is supported by returning the name, path, and instance ID of the destroyed object. This confirmation detail allows developers to verify which specific GameObjects and nested children were removed.

When should I not use DestroyImmediate for GameObjects in Unity?

You should not use DestroyImmediate during normal gameplay runtime logic due to its synchronous nature, but it is suitable here for managing scene clutter or cleaning up resources programmatically during game development.