🔌Interactable

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.

The script for the Interactable is MInteract.

Parameters

Index

Index of the Interactable. This value is used by the Interactor as an Event to identify with which interactable the Interactor is interacting.

Interactor ID

Which Interactors 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 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

On Interact with GO (GameObject)

Invoked when the Interactor executes an interaction. The parameter is the Interactor Gameobject

On Interact with (Int)

Invoked when the Interactor executes an interaction. The parameter is the Interactor Index. this is called right after the Event OnInteractWithGo(GameObject).

On Focused

Invoked when the Interactor has this Interactable as the focused Interactable.

On Unfocused

Invoked when the Interactor has lost this Interactable as the focused Interactable.

Last updated