unity-component

Manage Unity GameObject components including add, remove, copy, enable, and property editing.

Updated Jun 21, 2026
One-click install
npx skills add https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications --skill unity-component-du-qwq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-component
Source: https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications/tree/main/.agents/skills/unity-skills/skills/component
Command: npx skills add https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications --skill unity-component-du-qwq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Editing Unity GameObject components manually through the Inspector is slow and error-prone, especially when applying the same change across many objects. This Skill lets you add, remove, copy, enable/disable, and read or write component fields on GameObjects programmatically, with batch operations that collapse N API calls into one. ## Core Features & Use Cases - Component Lifecycle Management: Add, remove, list, and copy components between GameObjects, including exact-copy verification of serialized fields. - Property Reading & Writing: Read component properties and fields, set values for primitives, vectors, colors, enums, scene references, and asset references, plus Inspector SerializedProperty paths. - Batch Operations: Use component_add_batch, component_remove_batch, and component_set_property_batch to operate on many objects in a single call. - Use Case: You need to add a Rigidbody with mass 2.0 to 50 enemy objects. Instead of 100 individual calls, use two batch calls to add the component and set the mass on all of them at once. ## Quick Start Ask the AI to add a Rigidbody component to the GameObject named Player and set its mass property to 2.5.

Frequently Asked Questions about unity-component

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 programmatically?

Use component_add with the GameObject identifier (name, instanceId, or path) and the componentType string such as Rigidbody or BoxCollider. For multiple objects, use component_add_batch with a JSON array of items to perform all additions in one call.

How do I set a component property like Rigidbody mass in Unity?

Use component_set_property with the componentType, propertyName, and value. Values support primitives, vectors as {x, y, z} objects, colors as {r, g, b, a}, and enums as string names. Scene and asset references use referencePath, referenceName, or assetPath instead.

Can I copy a component from one GameObject to another in Unity?

Yes, component_copy duplicates a component from a source GameObject to a target GameObject using their names, instanceIds, or paths. Use component_copy_exact when you also need verification that all serialized Inspector fields match after the copy.

Why does component_add fail with a wrong component type name?

The componentType parameter is case-sensitive, so Rigidbody works but rigidbody does not. Custom scripts require the exact class name, and namespaced classes need the full form like MyNamespace.MyScript.

When should I use batch component operations instead of single calls?

Use batch skills whenever operating on two or more objects, since they reduce N API calls to one. component_add_batch, component_remove_batch, and component_set_property_batch each accept a JSON array of per-item objects and return per-item success results.

Why is component_remove forbidden in some execution modes?

component_remove and component_remove_batch are flagged as high-risk delete operations. In Approval or Auto modes they return MODE_FORBIDDEN and only execute under Bypass mode or when explicitly allowlisted.