# Interactable

## &#x20;Overview

This component is often used to create interaction with the animals, even though it has no dependencies with the Animal Controller,  it can be used as a stand-alone component, along with the Interactor script.

{% hint style="info" %}
The script for the Interactable is **MInteract**.
{% endhint %}

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

## Parameters

### Index

Index of the Interactable. This value is used by the [Interactor](/animal-controller/global-components/interactor.md) as an Event to identify with which interactable the [Interactor](/animal-controller/global-components/interactor.md) is interacting.

### Interactor ID

Which [Interactors ](/animal-controller/global-components/interactor.md)can interact with this Interactable, by default is set to -1 which means this interactable can interact will all interactors.

### Auto Interact

If the [Interactor](/animal-controller/global-components/interactor.md) has this interactable focus, it will apply the Interaction logic automatically, without having to call the Interact() method.

### Single Interaction

Interact once. After an interaction is executed with this interactable, this component will be disabled, so it no longer can be used.

### Delay

Delay time to execute/call the interaction logic.

### Cooldown

The time needed to elapse between interactions. This only works when Single Interaction is set to false

## Events

<figure><img src="/files/8YNUKwmoPQNosq6IuJ8w" alt=""><figcaption></figcaption></figure>

### On Interact with GO (GameObject)

Invoked when the Interactor executes an interaction. The parameter is the [Interactor](/animal-controller/global-components/interactor.md) Gameobject

### On Interact with (Int)

Invoked when the Interactor executes an interaction. The parameter is the [Interactor](/animal-controller/global-components/interactor.md) Index. this is called right after the Event OnInteractWithGo(GameObject).

### On Focused

Invoked when the [Interactor](/animal-controller/global-components/interactor.md) has this Interactable as the focused Interactable.&#x20;

### On Unfocused

Invoked when the [Interactor](/animal-controller/global-components/interactor.md) has **lost** this Interactable as the focused Interactable.&#x20;


---

# 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://malbersanimations.gitbook.io/animal-controller/global-components/interactable.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.
