Add Component
unity_add_componentAttach a component by type to a GameObject in Unity, using Undo for safe edits. Check existing components first to avoid duplicates.
Instructions
Add a component by type name to a GameObject. Uses Undo.
Example: {"path":"Player","component_type":"Rigidbody"}. Check unity_get_components first to avoid duplicates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Hierarchy path of the GameObject, e.g. 'Player' or 'Level/Enemies/Orc' | |
| component_type | Yes | Component type name, e.g. 'Rigidbody', 'BoxCollider', 'Light' |