# Triggers

There are multiple triggers available in the framework that will most likely to fit your basic needs. All of them are currently Collider based.

There are two abstract classes: superclass for the Collider based triggers and Activation Delayed trigger. You can find them in *Triggers -> abstract*. Nevertheless, abstract means that you cannot, neither it's needed, instantiate these classes alone. Eventually, they contain no triggering logic. What they do is provides you with the set of basic parameters that will be useful for this type of triggers.

### CoreColliderBasedPuzzleTriggers

At first, it ensures that the object has a Collider component on it.

At second, it provides a field where you can specify all tags that will be tracked. By default, there is a single active tag, "Player". It means that only game objects with the tag "Player" will be able to trigger it.

### ActivationDelayedPuzzleTriggers

Provides basic fields and methods for the triggers that need a continuous interaction in order to be activated. It contains the *activationDelay* property that specifies the time needed to activate the trigger. Moreover, it contains *ProceedDelay* coroutine that handles this delay and invokes *TriggerImpl* at the end.

{% hint style="warning" %}
You must inherit *CorePuzzleTrigger* for your own triggers. See the corresponding section in order to understand what kind of methods and fields are available to you.
{% endhint %}

{% hint style="info" %}
It's recommended to inherit *CoreColliderBasedTrigger* if you want to write your own more complex Collider based triggers, although not enforced.

Note that, in its turn, *CoreColliderBasedTrigger* inherits from *CorePuzzleTrigger*, meaning that in this case you don't have to inherit the latter.

*ActivationDelayedPuzzleTriggers* in its turn inherits from *CoreColliderBasedTrigger*.
{% endhint %}

## OnTriggerEventPuzzleTrigger

This type of trigger will require the object with the compatible tags to enter or exit a dedicated collider-trigger zone.

## OnKeyEventPuzzleTrigger

This type of trigger will require the object with the compatible tags to click a specific key on the keyboard while inside the collider-trigger zone.

## OnMouseEventPuzzleTrigger

This type of trigger will require the mouse button to interact with its collider.


---

# 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://puzzlesystem.gitbook.io/project/manual/triggers.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.
