# Object references

It's a common pattern in Unity to reference objects and components from one Prefab to another. A simple example is Cinemachine: to target an object with a camera, you normally assign that object's Transform to the **Tracking Target** property of a CinemachineCamera.

<figure><img src="/files/sr3QLjjitcF2ESP87sYn" alt="" width="563"><figcaption><p>A CinemachineCamera needing to reference a Transform as a target</p></figcaption></figure>

But how to do it when the object you want to assign simply isn't visible, because it's a child of a locked Prefab?

This is why you might want to expose an object reference on the BlackBox. When you do so, the reference will be visualised as an ObjectField without the little circular "picker icon":

<figure><img src="/files/xPnPpUNFka9zJeP3WDx0" alt="" width="563"><figcaption><p>The object reference as seen on the BlackBox component, in the scene</p></figcaption></figure>

From here, you can simply right-click on the field and choose **Copy**, and then paste where you need this reference.

{% hint style="success" %}
You will notice that trying to change the reference or nulling it shouldn't work, so you can't break the reference involuntarily with an override while you work on the Prefab.
{% endhint %}

## Revealing object references

To reveal a reference, you can do it in two ways:

### On the BlackBox component

Click on the **Show Available Properties and Methods** button on the BlackBox, and expand the foldouts until you arrive to the gameObject or component you're interested in.

Object References are preceded by a small **\[R]** letter:

<figure><img src="/files/fWA8jOjEKzdHZc3y88U0" alt="" width="563"><figcaption></figcaption></figure>

Press the **\[+]** button to add the component or gameObject to the reveal list.

### Via the context menu

References to components can also be revealed in context. While you have the right GameObject selected, right-click the component's title bar and choose **BlackBox > Reference to Component > Reveal in...**, like so:

<figure><img src="/files/H6YQhN6Hx9dWr93IeWqa" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
**First List, Second List... what are they?**

Unfortunately, a Unity limitation means we can't display the custom names that you might have assigned to [Reveal lists](/black-box/main-features/reveal/reveal-lists.md), and that's why they are displayed as First List, Second List, etc. up to 5 lists.

To add components to a higher number list, you can move the list in one of the first 5 positions, add the component, and move it back (using the reorder buttons in [Edit mode](/black-box/main-features/reveal/reveal-lists.md#edit-lists)).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tools.continis.io/black-box/main-features/reveal/object-references.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
