gameobject-component-destroy

gameobject-component-destroy is a skill for Claude Code, Codex from IvanMurzak/Unity-MCP. It costs 49 tokens per session (1,606 once invoked), scanned A, original, Apache-2.0.

A Unity operation for removing one or more components from a GameObject, which is an object in a Unity scene or project. It skips missing components and reports an error when none of the requested components are found.

In plain words
What is it for?
Use it after finding a Unity GameObject and its components to destroy one or several specific components from that object.
Why use it?
It lets you remove selected behavior or data components while checking that the requested components actually belong to the target object. The error details can help identify available components when a match is missing.

Skill for Claude CodeCodex

About the project

Unity-MCP connects AI coding agents to the Unity game engine through MCP, letting them work with the Unity Editor and running games. It is used by game developers to generate code, automate development and testing, debug projects, and add AI-driven behavior to games. The catalogue entries provide skills, instructions, an MCP integration, and settings for operating this workflow.

IvanMurzak/Unity-MCP · 4,148 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ivanmurzak/unity-mcp/gameobject-component-destroy
Any agent
npx skills add IvanMurzak/Unity-MCP --skill gameobject-component-destroy
Clone the repo
git clone --depth 1 https://github.com/IvanMurzak/Unity-MCP

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gameobject-component-destroy

README.md
[![agentmods](https://agentmods.dev/badge/skills/ivanmurzak/unity-mcp/gameobject-component-destroy.svg)](https://agentmods.dev/skills/ivanmurzak/unity-mcp/gameobject-component-destroy)
Your own site
<a href="https://agentmods.dev/skills/ivanmurzak/unity-mcp/gameobject-component-destroy"><img src="https://agentmods.dev/badge/skills/ivanmurzak/unity-mcp/gameobject-component-destroy.svg" alt="Measured on agentmods" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,606 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00049 $0.01606
Opus 5 $0.00024 $0.00803
Sonnet 5 $0.00010 $0.00321
Haiku 4.5 $0.00005 $0.00161

Measured 5d ago against content hash f13b8293965c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gameobject-component-destroy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Unity-MCP-Plugin/.claude/skills/gameobject-component-destroy/SKILL.md · 200 lines

How it starts

The opening of the file, as written. The whole thing — 200 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GameObject / Component / Destroy

Destroy one or many components from target GameObject. Can't destroy missed components. Use 'gameobject-find' tool to find the target GameObject and 'gameobject-component-get' to get component details first.

Inputs

  • gameObjectRef — the host GameObject.
  • destroyComponentRefsComponentRefList of components to destroy (matched against the GameObject's components).

Behavior

Iterates go.GetComponents<Component>(), skipping null entries (missing scripts). For each non-null component that matches one of destroyComponentRefs, the tool snapshots a ComponentRef, calls Object.DestroyImmediate, and records the destroyed reference. If no component matches at all, throws with the help text from Error.NotFoundComponents (which includes a preview of all available components on the GameObject).

How to Call

unity-mcp-cli run-tool gameobject-component-destroy --input '{
  "gameObjectRef": "string_value",
  "destroyComponentRefs": "string_value"
}'

For complex input (multi-line strings, code), save the JSON to a file and use:

unity-mcp-cli run-tool gameobject-component-destroy --input-file args.json

Or pipe via stdin (recommended):

unity-mcp-cli run-tool gameobject-component-destroy --input-file - <<'EOF'
{"param": "value"}
EOF

Troubleshooting

If unity-mcp-cli is not found, either install it globally (npm install -g unity-mcp-cli) or use npx unity-mcp-cli instead. Read the /unity-initial-setup skill for detailed installation instructions.

Input

Name Type Required Description
gameObjectRef any Yes Find GameObject in opened Prefab or in the active Scene.
destroyComponentRefs any Yes Component reference array. Used to find Component at GameObject.

Input JSON Schema

{
  "type": "object",
  "properties": {
    "gameObjectRef": {
      "$ref": "#/$defs/AIGD.GameObjectRef"
    },
    "destroyComponentRefs": {
      "$ref": "#/$defs/AIGD.ComponentRefList"
    }
  },
  "$defs": {
    "System.Type": {
      "type": "string"
    },
    "AIGD.GameObjectRef": {
      "type": "object",
      "properties": {
        "instanceID": {
          "type": "integer",
          "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
        },
        "path": {
          "type": "string",
          "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
        },
        "name": {
          "type": "string",
          "description": "Name of a GameObject in hierarchy. Priority: 3."
        },
        "assetType": {
          "$ref": "#/$defs/System.Type",
          "description": "Type of the asset."
        },
        "assetPath": {
          "type": "string",
          "description": "Path to the asset within the project. Starts with 'Assets/'"
        },
        "assetGuid": {
          "type": "string",
          "description": "Unique identifier for the asset."
        }
      },
      "required": [
        "instanceID"
      ],
      "description": "Find GameObject in opened Prefab or in the active Scene."
    },
    "AIGD.ComponentRef": {
      "type": "object",
      "properties": {
        "index": {
          "type": "integer",
          "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1."
        },
        "typeName": {
          "type": "string",
          "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null."
        },
        "instanceID": {
          "type": "integer",
          "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
        }
      },
      "required": [
        "index",
        "instanceID"
      ],
      "description": "Component reference. Used to find a Component at GameObject."
    },
    "AIGD.ComponentRefList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AIGD.ComponentRef",
        "description": "Component reference. Used to find a Component at GameObject."
      },
      "description": "Component reference array. Used to find Component at GameObject."
    }
  },
  "required": [
    "gameObjectRef",
    "destroyComponentRefs"
  ]
}

Read the full file on GitHub · 200 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 200 lines · 49 tokens per session scan A f13b8293965c

Subscribe to this mod's changes

gameobject-component-destroy is a skill published in the GitHub repository IvanMurzak/Unity-MCP (4,148 stars, last pushed today), licensed Apache-2.0. It adds 49 tokens to every session and 1,606 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

unity-mcp-orchestrator

Orchestrate Unity Editor via MCP (Model Context Protocol) tools and resources. Use when working with Unity projects through MCP for Unity - creating/modifying GameObjects, editing scripts, managing scenes, running tests, or any Unity Editor automation. Provides best practices, tool schemas, and workflow patterns for…

CoplayDev/unity-mcp · 72 tokens

blender-to-unity

Hand off a model from Blender (via BlenderMCP) into Unity (via MCP for Unity) — export the current Blender model, import it through importmodelfile, and place it in the open scene. Use when the user has BlenderMCP and MCP for Unity both connected and wants to bring a Blender model into Unity. Does NOT drive Blender's…

CoplayDev/unity-mcp · 91 tokens

mcp-source

Switch MCP for Unity package source in connected Unity projects. Use /mcp-source [main|beta|branch|local] to swap between upstream releases, your remote branch, or local dev checkout.

CoplayDev/unity-mcp · 44 tokens

executing-csharp-scripts-in-unity-editor

Use this skill always when you need to use executecsharpscriptinunityeditor tool to modify scenes, add, remove or modify game objects, components, scriptable objects or perform any other task in Unity Editor using C# scripts. Also covers when and how to use readunityconsolelogs and rununitytests tools as part of the…

Signal-Loop/UnityCodeMCPServer · 95 tokens

unity-game-player

Autonomous Unity game-playing skill for AI agents. Provides the complete closed-loop workflow (INIT → SENSE+COMPUTE → ACT → REPEAT) for dynamically discovering game mechanics, reading live state via C# script execution, computing mathematically precise actions, and simulating player input. Use when an agent must play…

Signal-Loop/UnityCodeMCPServer · 118 tokens

creating-python-scripts

Use when creating or editing a Python script, utility, CLI helper, one-off automation, or small standalone Python program that should stay as a script instead of becoming a multi-file project.

Signal-Loop/UnityCodeMCPServer · 42 tokens