unity-component
Skill7 starsChanged 7 months agoMITView on GitHub
Use when users want to add, remove, or configure components like Rigidbody, Collider, AudioSource.
In this repository34 other files it gives its agents.
- unity-mcp-skillsSkill
- unity-animatorSkill
- unity-assetSkill
- unity-cameraSkill
- unity-cinemachineSkill
- unity-cleanerSkill
- unity-consoleSkill
- unity-editorSkill
- unity-eventSkill
- unity-gameobjectSkill
- unity-importerSkill
- unity-lightSkill
- unity-materialSkill
- unity-navmeshSkill
- unity-optimizationSkill
- unity-packageSkill
- unity-perceptionSkill
- unity-physicsSkill
- unity-prefabSkill
- unity-probuilderSkill
- unity-projectSkill
- unity-sceneSkill
- unity-scriptableobjectSkill
- unity-scriptSkill
- unity-shaderSkill
- unity-smartSkill
- unity-terrainSkill
- unity-testSkill
- unity-timelineSkill
- unity-toolingSkill
- unity-uiSkill
- unity-uitoolkitSkill
- unity-validationSkill
- unity-xrSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 47
Add a component to a GameObject.
- Distinctive: line 61
Remove a component from a GameObject.
- Distinctive: line 118
Add components to multiple objects.
- Distinctive: line 125
Remove components from multiple objects.
- Distinctive: line 183
Add colliders before Rigidbody for physics
- Very specific: line 184
Use component_list to verify additions
- Very specific: line 185
Check property names with component_get_properties first
- Distinctive: line 187
Use full type names for custom scripts (e.g., "MyNamespace.MyScript")
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Unity Component Skills
Overview
BATCH-FIRST: Use
*_batchskills when operating on 2+ objects to reduce API calls from N to 1.
Common Mistakes
DO NOT (common hallucinations):
component_create/component_getdo not exist → usecomponent_add(add) andcomponent_get_properties(read)component_finddoes not exist → usecomponent_listto list components on an objectcomponentTypeis case-sensitive —Rigidbodynotrigidbody,BoxCollidernotboxcollider- Custom scripts need exact class name; if namespaced, use
Namespace.ClassName
Routing:
- To create a C# component script → use
scriptmodule'sscript_createfirst, thencomponent_add - To set multiple properties at once → use
component_set_property_batch - To enable/disable a component →
component_set_enabled(notcomponent_set_property)
Object Targeting: All single-object skills accept
name(string),instanceId(int, preferred), andpath(string, hierarchy path). Provide at least one.
Skills Overview
| Single Object | Batch Version | Use Batch When |
component_add | component_add_batch | Adding to 2+ objects |
component_remove | component_remove_batch | Removing from 2+ objects |
component_set_property | component_set_property_batch | Setting on 2+ objects |
Other Skills (no batch):
component_list- List all components on an objectcomponent_get_properties- Get component property valuescomponent_set_enabled- Enable/disable a component (Behaviour, Renderer, Collider)component_copy- Copy a component from one object to another
Single-Object Skills
component_add
Add a component to a GameObject.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
instanceId | int | No* | Instance ID (preferred) |
path | string | No* | Hierarchy path |
componentType | string | Yes | Component type name |
*At least one identifier required
Returns: {success, gameObject, instanceId, component, fullTypeName}
component_remove
Remove a component from a GameObject.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
instanceId | int | No* | Instance ID |
componentType | string | Yes | Component type to remove |
Returns: {success, gameObject, removed}
component_list
List all components on a GameObject.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
instanceId | int | No* | Instance ID |
Returns: {gameObject, instanceId, path, componentCount, components: [{type, fullType, enabled}]}
component_set_property
Set a component property value.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
instanceId | int | No* | Instance ID |
componentType | string | Yes | Component type |
propertyName | string | Yes | Property to set |
value | any | Cond. | New value (for basic types, vectors, colors) |
referencePath | string | No | Scene object hierarchy path (for scene references) |
referenceName | string | No | Scene object name (for scene references) |
assetPath | string | No | Project asset path (for asset references: Material, Texture, AudioClip, ScriptableObject, Prefab, etc.) |
Provide one of:
value(basic types),referencePath/referenceName(scene objects), orassetPath(project assets).
value type examples:
See ../../recipes/component/component_set_property.md for value format details and C# template.
Returns: {success, gameObject, component, property, valueSet, valueType}
component_get_properties
Get all properties of a component.
| Parameter | Type | Required | Description |
name | string | No* | GameObject name |
instanceId | int | No* | Instance ID |
componentType | string | Yes | Component type |
Returns: {gameObject, component, fullTypeName, properties: [{name, type, value, canWrite}], fields: [{name, type, value, isSerializable}]}
Batch Skills
component_add_batch
Add components to multiple objects.
Returns: {success, totalItems, successCount, failCount, results: [{success, gameObject, componentType, added}]}
See ../../recipes/component/component_add_batch.md for C# template.
component_remove_batch
Remove components from multiple objects.
Returns: {success, totalItems, successCount, failCount, results: [{success, gameObject, componentType, removed}]}
See ../../recipes/component/component_remove_batch.md for C# template.
component_set_property_batch
Set properties on multiple objects.
Returns: {success, totalItems, successCount, failCount, results: [{success, gameObject, componentType, property, oldValue, newValue}]}
See ../../recipes/component/component_set_property_batch.md for C# template.
Common Component Types
Physics
| Type | Description |
Rigidbody | Physics simulation |
BoxCollider | Box collision |
SphereCollider | Sphere collision |
CapsuleCollider | Capsule collision |
MeshCollider | Mesh-based collision |
CharacterController | Character movement |
Rendering
| Type | Description |
MeshRenderer | Render meshes |
SkinnedMeshRenderer | Animated meshes |
SpriteRenderer | 2D sprites |
LineRenderer | Draw lines |
TrailRenderer | Motion trails |
Audio
| Type | Description |
AudioSource | Play sounds |
AudioListener | Receive audio |
UI
| Type | Description |
Canvas | UI container |
Image | UI images |
Text | UI text (legacy) |
Button | Clickable button |
Example: Efficient Physics Setup
See ../../recipes/component/README.md for all component recipes.
Best Practices
- Add colliders before Rigidbody for physics
- Use
component_listto verify additions - Check property names with
component_get_propertiesfirst - Some properties are read-only (will fail to set)
- Use full type names for custom scripts (e.g., "MyNamespace.MyScript")
Additional Skills
component_copy
Copy a component from one GameObject to another.
| Parameter | Type | Required | Default | Description |
sourceName | string | No* | null | Source GameObject name |
sourceInstanceId | int | No* | 0 | Source Instance ID |
sourcePath | string | No* | null | Source hierarchy path |
targetName | string | No* | null | Target GameObject name |
targetInstanceId | int | No* | 0 | Target Instance ID |
targetPath | string | No* | null | Target hierarchy path |
componentType | string | Yes | - | Component type to copy |
*At least one source identifier and one target identifier required
Returns: { success, source, target, componentType }
component_set_enabled
Enable or disable a component (Behaviour, Renderer, Collider, etc.).
| Parameter | Type | Required | Default | Description |
name | string | No* | null | GameObject name |
instanceId | int | No* | 0 | Instance ID |
path | string | No* | null | Hierarchy path |
componentType | string | Yes | - | Component type to enable/disable |
enabled | bool | No | true | Whether to enable or disable |
*At least one identifier required
Returns: { success, gameObject, componentType, enabled }
Recipe path rule: ../../recipes/component/<command>.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

