unity_set_object_reference
Assign an object reference to a component property using a hierarchy path, instance ID, or asset path. Useful for linking scene objects or assets.
Instructions
[LEGACY] Set an object reference on a component. Prefer unity_component_set_reference (richer resolution).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Hierarchy path of the target GameObject | |
| port | No | Unity instance port (from unity_select_instance). Always include it when multiple instances run. | |
| instanceId | No | Instance ID (alternative to path) | |
| propertyName | Yes | Name of the ObjectReference property to set | |
| componentType | No | Component type name (optional - will search all components) | |
| 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) |