⚡Interactor
✔
Last updated
✔
Last updated
This component stores the Index and GameObject of an Interactable and invokes events that can be used to create Reactions according to each interactable value. It also executes the Interaction logic on the Interactable.
Place the Interactor on your character and add an Interaction Area (Collider). This will allow to detect interactables on the scene. When an Interactable is inside the Collider, then the Interaction logic can be activated.
Either the Interactor or the Interactable gameobject needs to have a Rigidbody attached. Otherwise, the Interaction will not occur.
To activate the interaction you can add an Input to your Malbers Input Component and connect it directly to the Interactor.
If the Interactable is set to be Automatic then the interaction wont need Manual activation.
Use the reactions list to have different reactions with different Interactables IDs.
What layer will be checked on the interactables
Does the Interactor interact with triggers or just colliders?
Index of the Interactor. This parameter is received by the Interactable when Interact() is called to check who was the Interactor that activated the logic
Reference for the Collider that will be used for finding interactables [On Trigger Enter]
Invoked when the Interact() Method is called. Send as parameter the Interactable GameObject
Invoked when the Interact() Method is called. Send as parameter the Interactable Index
Invoked when an Interactable enters the Interaction Area. Send as parameter the Interactable GameObject
Invoked when an Interactable enters the Interaction Area. Send as parameter the Interactable GameObject
Check the Index of the Focused Iteractable. if is equal, Not Equal, Greater or Less than this value then Apply the Reaction.
Component that the reaction will be applied to
Reaction to apply to the target if the Index of the Focused interactable matches the Index Value