set_object_reference
Assign a serialized reference field on a Unity component to link a GameObject, Transform, or Component, wiring scene objects correctly; the field type is auto-detected.
Instructions
Set an object reference field on a component (e.g., assign a Transform to a serialized field). Use this to wire up references between GameObjects in the scene. The field type is auto-detected (Transform, GameObject, or specific Component). Requires BanterMCPBridge extension.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| objectId | No | Preferred: source GameObject globalObjectId from scene-hierarchy.json | |
| targetId | No | Preferred: target GameObject globalObjectId from scene-hierarchy.json | |
| objectPath | No | Legacy path selector for the GameObject containing the component | |
| targetPath | No | Legacy target path selector, or 'null' to clear | |
| componentId | No | Preferred when duplicate component types exist: source component globalObjectId | |
| propertyName | Yes | Serialized field name (e.g., 'headTarget', 'cameraRig') | |
| componentType | No | Component type name (e.g., 'VRPlayerController', 'PhysicsRig') | |
| targetComponent | No | Optional: specific component type on the target (e.g., 'Rigidbody'). If omitted, auto-detects based on field type. |