unity_set_object_reference
Set an object reference property on a Unity component using hierarchy path, instance ID, or asset path. Use for assigning prefabs, materials, or scene GameObjects to serialized ObjectReference fields.
Instructions
[LEGACY — prefer unity_component_set_reference] Set an object reference property on a component via the prefab system. Use unity_component_set_reference instead for richer resolution options.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Hierarchy path of the target GameObject | |
| instanceId | No | Instance ID (alternative to path) | |
| componentType | No | Component type name (optional - will search all components) | |
| propertyName | Yes | Name of the ObjectReference property to set | |
| referencePath | No | Asset path of the reference (for assets like prefabs, materials, textures) | |
| referenceGameObject | No | Name/path of a GameObject in the scene (for scene references) | |
| port | No | Target Unity instance port for parallel-safe routing. Get this from unity_select_instance. When working with multiple Unity instances, ALWAYS include this parameter. |