# Setting up the Detection Layers and Player Tag

## Setting up the Detection Layers and Player Tag

The Tag and Layer Settings controls an AI's Detection Layers and Player Tag. These are used to allow the AI to know what Layers are detectable targets as well as what targets are players.

To set up your Player Tag, assign your player object's Unity Tag (the tag that was assigned using Unity's Tag pulldown at the top of the gameobject).

{% hint style="warning" %}
**Important:** Ensure the Player Tag is set up correctly as skipping this step or applying the incorrect tag will result in AI being unable to detect player targets properly. This step is also important for allowing AI to use the Look At feature which allows AI to look at player targets while wandering, given they have a Friendly Relation Type.
{% endhint %}

<figure><img src="/files/3m3dn4IXu7djEsQMQCYf" alt=""><figcaption></figcaption></figure>

To assign layers to the Detection Layers, open the Layer Mask dropdown menu and assign the layers you want the AI to detect. This is typically a player layer and an AI layer. With this is example the enemy Layer is Enemy and the player layer is Player.

{% hint style="warning" %}
**Important:** Ensure the Detection Layers are set up correctly as skipping this step or applying the incorrect layers will result in AI being unable to detect targets.
{% endhint %}

<figure><img src="/files/lPAfDKCkb7VCtsX5xQDN" alt=""><figcaption></figcaption></figure>


---

# 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://black-horizon-studios.gitbook.io/emerald-ai-wiki/emerald-components-required/detection-component/setting-up-the-detection-layers-and-player-tag.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.
