gameobject-component-add

Adds components to GameObjects in Unity scenes or opened prefabs via unity-mcp-cli.

Updated May 28, 2026
One-click install
npx skills add https://github.com/ishaansingh-ai/Mechanical-2D --skill gameobject-component-add-ishaansingh-ai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gameobject-component-add
Source: https://github.com/ishaansingh-ai/Mechanical-2D/tree/main/.claude/skills/gameobject-component-add
Command: npx skills add https://github.com/ishaansingh-ai/Mechanical-2D --skill gameobject-component-add-ishaansingh-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires unity-mcp-cli.

What problem does it solve? Manually adding components to GameObjects in the Unity Editor is repetitive, especially when automating scene setup or batch-editing prefabs. This Skill lets you add one or more components to a target GameObject programmatically through the unity-mcp-cli command line. ## Core Features & Use Cases - Component Addition: Attach one or more components by full namespace-qualified class name to a GameObject in an opened prefab or the active scene. - Flexible GameObject Targeting: Locate the target GameObject by instanceID, hierarchy path, name, asset path, or asset GUID. - Structured Results: Returns lists of added components, success messages, warnings, and errors for verification. - Use Case: While building a character prefab, add a Rigidbody and CapsuleCollider to the root GameObject without opening the Unity Inspector. ## Quick Start Ask the AI to add a specific component, such as a Rigidbody, to a named GameObject in the current Unity scene using this skill.

Frequently Asked Questions about gameobject-component-add

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

FAQPage Schema
How do I add a component to a GameObject in Unity from the command line?▼

Run unity-mcp-cli run-tool gameobject-component-add with a JSON input containing componentNames and a gameObjectRef. The component name must include the full namespace path and class name, and the GameObject can be referenced by instanceID, hierarchy path, or name.

How do I find the correct component type name to add in Unity?▼

Use the gameobject-component-list-all tool to discover available component type names before adding them. Component names must be fully qualified with their namespace, such as UnityEngine.Rigidbody, otherwise the addition will fail.

Can I add multiple components to a GameObject at once?▼

Yes, the componentNames parameter accepts an array of strings, so you can pass several fully qualified component type names in a single call. The response reports added components, messages, warnings, and errors for each.

What should I do if unity-mcp-cli is not found?▼

Install it globally with npm install -g unity-mcp-cli, or prefix commands with npx unity-mcp-cli. The unity-initial-setup skill provides detailed installation instructions.

Does this work on prefabs as well as scene GameObjects?▼

Yes, the tool targets GameObjects in an opened prefab or in the active scene. You can reference prefab assets using assetPath starting with Assets/ or an assetGuid in the gameObjectRef input.