gameobject-component-add
Add components to a GameObject in a prefab or scene using component type names and a game object reference.
Instructions
Add Component to GameObject in opened Prefab or in a Scene. Use 'gameobject-find' tool to find the target GameObject first. Use 'gameobject-component-list-all' tool to find the component type names to add.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"componentNames": "<componentNames>",
"gameObjectRef": "<gameObjectRef>"
},
"name": "gameobject-component-add"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| componentNames | Yes | Array of component type names to add. Example: ["BoxCollider","Rigidbody"] | |
| gameObjectRef | Yes | Target GameObject. SCHEMA: {"name":"ObjectName"} or {"instanceID":12345} or {"path":"hierarchy/path"} |