gameobject-set-parent
Set parent for multiple GameObjects in a Unity scene or prefab while optionally preserving world positions. Specify child objects and new parent; use null to unparent. Ideal for organizing hierarchies.
Instructions
Set parent GameObject to list of GameObjects in opened Prefab or in a Scene. Use 'gameobject-find' tool to find the target GameObjects first.
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": {
"gameObjectRefs": "<gameObjectRefs>",
"parentGameObjectRef": "<parentGameObjectRef>"
},
"name": "gameobject-set-parent"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gameObjectRefs | Yes | Array of GameObjectRef to reparent. SCHEMA: [{"name":"ChildObject"}] | |
| parentGameObjectRef | Yes | New parent. SCHEMA: {"name":"ParentObject"} or {"instanceID":12345}. Use null to unparent. | |
| worldPositionStays | No | A boolean flag indicating whether the GameObject's world position should remain unchanged when setting its parent. | true |