> For the complete documentation index, see [llms.txt](https://docs.otherside.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otherside.xyz/odk-docs/odk-plugin/odk-interaction.md).

# ODK Interaction

The ODK interaction system facilitates interactions between the player character and in world props.<br>

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

## Basic Interaction Flow

Player characters have the `BPC_ODK_InteractionComponent` attached to them. All interactable actors have a `BPC_ODK_InteractableComponent` attached to them. The `BPC_ODK_InteractionComponent` periodically polls interactable components to see which is the current `BPC_ODK_InteractableComponents` the player can interact with in the world. When the player inputs the "Interact" input action event, the `BPC_ODK_InteractionComponent` will inform the currently interactable `BPC_ODK_InteractableComponent` that it needs to execute it's logic.

## Setting up a new Interaction

If you want to set up a new prop actor to have interactions, the simplest method is to attach a `BPC_ODK_InteractableComponent_WidgetPopup` to your actor. Once this is done, select the component in the "Viewport" and move it to an appropriate position on your actor. This should be a location where you expect the camera to be looking when the player interacts with the object.\
\
Now, you can hook into events on the component to execute your behaviour:\
\- `OnInteract`: Execute your custom interaction logic\
\- `OnFocused`: Marks the interactable component as the active target, allowing it to receive interaction input when the player presses the designated key.\
\- `OnUnfocused`: Removes the component as the active target, preventing it from receiving interaction input.\
\
Lastly, we can configure the `BPC_ODK_InteractableComponent_WidgetPopup` properties:\
\- `Interaction Distance`: the distance within which the player character needs to be to interact with this component.\
\- `Priority`: If multiple interactables are able to be interacted with at one time, the highest priority interactable will take precedence.\
\- `Widget Transform`: Allows you to configure where the popup widget will be displayed in relation to your actor. We recommend setting the widget to sit above your actor<br>

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.otherside.xyz/odk-docs/odk-plugin/odk-interaction.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.
