# Odin Inspector

BlackBox integrates with [Odin Inspector](https://odininspector.com/), and can display most of its attributes correctly for properties that [have been revealed](/black-box/main-features/reveal.md) in the BlackBox component.

{% hint style="warning" %}
Please note that when Odin is installed in your project, you will **lose the ability** to [right-click > "Reveal on BlackBox"](/black-box/main-features/reveal.md#via-the-context-menu) in all Inspectors drawn by Odin. You can still reveal properties [from the BlackBox component](/black-box/main-features/reveal.md#on-the-blackbox-component).
{% endhint %}

## How to enable Odin integration

First, obviously, you need to have Odin Inspector in your project. This should automatically add some scripting define symbols to your project. If you're in doubt, go to **Project Settings > Player > Other settings > Scripting Define Symbols**, and ensure that the symbol `ODIN_INSPECTOR` is there:

<figure><img src="/files/mAovBuBBki3eOQGbQgZ4" alt=""><figcaption></figcaption></figure>

## Revealing a property with Odin

By default, if you reveal a property that uses one of Odin's attributes, it will just display with its original, Unity-official property drawer. Let's assume for instance a property decorated with `[RangeSlider]`:

```csharp
[MinMaxSlider("DynamicRange", true)]
public Vector2 DynamicMinMax = new Vector2(25, 50);
public Vector2 DynamicRange = new Vector2(0, 50);
```

By default, once revealed, this property would just show as a Vector2:

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

To ensure it displays correctly, you need to add the `[RevealWithOdin]` attribute:

{% code fullWidth="false" %}

```csharp
[MinMaxSlider("DynamicRange", true), RevealWithOdin]
public Vector2 DynamicMinMax = new Vector2(25, 50);
public Vector2 DynamicRange = new Vector2(0, 50);
```

{% endcode %}

With it, it will automatically display as expected:

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

## Caveats

When revealing a property that is decorated with an Odin attribute, there are some things to keep in mind:

* Not all attributes are supported. Especially the ones heavily modifying the layout (like `[Box]` or `[FoldoutGroup]`) will not work.
* You won't be able to reveal Odin properties by [right-clicking the original property](/black-box/main-features/reveal.md#revealing-properties-via-context-menu) and choosing "Reveal with Blackbox". You need to find the property on the BlackBox component, by clicking the "Show Available Properties" button (as described [here](/black-box/main-features/reveal.md#on-the-blackbox-component)).
* Even if you [disable Apply](/black-box/main-features/disable-apply.md) for a particular prefab, the user will always be able to Apply on Odin-decorated properties. This is unfortunately something we cannot override.
* Odin-decorated properties don't play well with the Prefab system, and don't support nested Prefabs. This is a general Odin limitation, and something we don't have control on.

If a property is misbehaving or doesn't look correct, just remove the `[RevealWithOdin]` from it to draw it again using its default Unity-provided Property Drawer.


---

# 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/integrations/odin-inspector.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.
