gameobject-component-add

Adds one or more Components to a GameObject in a Unity Prefab or active Scene.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/PMK95/GridSquad --skill gameobject-component-add-pmk95
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gameobject-component-add
Source: https://github.com/PMK95/GridSquad/tree/main/GridSquadUnity/.agents/skills/gameobject-component-add
Command: npx skills add https://github.com/PMK95/GridSquad --skill gameobject-component-add-pmk95

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires unity-mcp-cli.

What problem does it solve? Manually attaching Components to GameObjects in Unity through the editor is slow and repetitive, especially when configuring many objects or working through an AI assistant. This Skill lets you add one or more Components to a GameObject in the opened Prefab or active Scene programmatically via the unity-mcp-cli. ## Core Features & Use Cases - Batch Component Addition: Add multiple Components in a single call, with per-name errors collected in the response instead of aborting the whole batch. - Flexible Type Resolution: Component types are resolved by fully-qualified name (with namespace) or by bare class-name fallback against all available component types. - Structured Results: Successful additions return ComponentDataShallow snapshots (instanceID, typeName, isEnabled), while warnings and errors are reported separately. - Use Case: After locating a character GameObject with 'gameobject-find', add a Rigidbody, CapsuleCollider, and custom script Component in one command, then verify which additions succeeded from the response. ## Quick Start Ask the AI to add a Rigidbody and a CapsuleCollider component to the GameObject named Player in the active Unity scene.

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 with the gameobject-component-add tool, passing componentNames and a gameObjectRef. The target GameObject can be identified by instanceID, hierarchy path, or name in the opened Prefab or active Scene.

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

Use the gameobject-component-list-all tool to discover valid component type names. Fully-qualified names with namespace are preferred, but bare class names are resolved through a fallback against all available component types.

What happens if one component name is invalid in a batch add?▼

The batch does not abort. Per-name errors such as unknown types, non-Component types, or duplicate add failures are collected in the response Errors and Warnings lists, while successful additions are returned in AddedComponents.

Why is unity-mcp-cli not found when running the command?▼

The CLI is not installed or not on your PATH. Install it globally with npm install -g unity-mcp-cli, or invoke it through npx unity-mcp-cli. The unity-initial-setup skill covers detailed installation steps.

Can I add components to a GameObject inside a Prefab asset?▼

Yes, components can be added to GameObjects in the currently opened Prefab as well as in the active Scene. Reference the target by instanceID, hierarchy path, or name within that context.