# 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="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FWhtQKwgNzwSNU3QrWJ4o%2Fimage.png?alt=media&#x26;token=d3abe4dc-f0c9-47e0-985f-63dea4772e7a" alt=""><figcaption></figcaption></figure>

## Parameters

### Index

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

### Interactor ID

Which [Interactors ](https://malbersanimations.gitbook.io/animal-controller/global-components/interactor)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](https://malbersanimations.gitbook.io/animal-controller/global-components/interactor) 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="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FSDAq8EoRb0TcmnejF5f3%2Fimage.png?alt=media&#x26;token=b18ac294-f5f7-4d61-bf18-df6482665bb8" alt=""><figcaption></figcaption></figure>

### On Interact with GO (GameObject)

Invoked when the Interactor executes an interaction. The parameter is the [Interactor](https://malbersanimations.gitbook.io/animal-controller/global-components/interactor) Gameobject

### On Interact with (Int)

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

### On Focused

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

### On Unfocused

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