# Perception

An intelligent agent is more than a bunch of conditions and branching logic. It has to be aware of its surrounds, as well as know to to discern what is something that is important enough to  catch its attention than from scene foliage.

![](https://2174264233-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAqwYovmUPn5V6CMeID%2F-LaG11KFzn3g5hTBOpu3%2F-LaG4tlw7oULiabNkTSg%2Fperceptors.jpeg?alt=media\&token=25aeb315-65d0-45b5-99c1-0cdb7536b20c)

{% hint style="warning" %}
The **Behavior** module is still in Beta and only one **Perceptor** is available: ***Sight***. ***Smell*** and ***Hearing*** are coming soon.
{% endhint %}

## Perceptrons

The **Behavior** module comes with a **Perception** component that addresses this problem. This **Perception** component comes with different ***Perceptors*** (aka *Senses*) that the agent will store in its memory and keep track of them.

### Sight

The most common perceptron. Sight allows an agent to know the location of another object and identify it.

{% hint style="info" %}
For example, a *Guard* might be in search for the player. The **Sight** perceptron, then,  is set up to keep track of the **Player**.
{% endhint %}

![](https://2174264233-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAqwYovmUPn5V6CMeID%2F-LaG11KFzn3g5hTBOpu3%2F-LaGATKss3PnTBQ1XLad%2Fbehavior-perceptron-sight.jpg?alt=media\&token=7879bd4c-85b3-46ae-82ce-879c5510960a)

* **Field of View:** Vision cone for the character. The human eye has a cone of 120 degrees, but can perceive movement a bit further.
* **Vision Distance:** Length where the horizon is drawn for the character.
* **Sight Layer Mask:** Which objects occlude other objects. Transparent objects should be added in a separate layer for a character to see through them.

![(Visual representation of Field of View and Vision Distance)](https://2174264233-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAqwYovmUPn5V6CMeID%2F-LaGAcGT_OO-rO-TSR6p%2F-LaGDOAAJ5zxvLaODHf9%2Fbehavior-perceptron-sight-scene.jpg?alt=media\&token=197c4331-3df7-4981-987a-bfb90693c01f)

There are two ways you can use the **Perceptrons**. One is through the use of a **Trigger**. The other one is using a **Condition**.

You can make a **Trigger** execute a list of **Actions** or **Conditions** detecting when an object becomes visible by the **Perception** component.

![(Left: Trigger detecting when the Player is in seen. Right: Using the Sight Condition)](https://2174264233-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAqwYovmUPn5V6CMeID%2F-LaGAcGT_OO-rO-TSR6p%2F-LaGFUS7PL__veeoNKaB%2Fbehavior-perceptron-sight-options.jpg?alt=media\&token=84fb98a2-c2a6-4da1-b444-3a8b0491a08f)

{% hint style="success" %}
We recommend using the **Trigger** method unless you're working with the **Behavior Graph**, which might suit better just checking whether the *Invoker* sees a particular object.
{% endhint %}
