# Predator

{% hint style="success" %}
**COPY/PASTE PARAMETERS**

New in GM 0.11! Right click on a behaviour or component to copy. Then open an object, add the same behaviour or component, and right click it to paste identical parameter settings.
{% endhint %}

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

{% hint style="info" %}
This behaviour has not yet been migrated for use in multiplayer Experiences.
{% endhint %}

## ![](/files/ajYQxmtdnK0sTHQ2S15I) Predator

* Walk within a defined zone
* Attacks specific targets within its range
* Once it detects a target (ground prey or avatar by default), it runs towards it and its speed is increased
* Every time it attacks a target, it deals damage to it
* Once its target is killed, it goes for another one if its hunger hasn’t reached its maximum yet

## Common Uses

* An aggressive Behavior often used for animals that will attack other weaker animals
* A creature with hunger that will stop it from attacking when full, with a ranged attack

## Communications

<table data-header-hidden><thead><tr><th width="278"></th><th></th></tr></thead><tbody><tr><td><p><strong>Inputs:</strong></p><p>Detects specified Tags (default Tag is Prey)</p></td><td><p><strong>Outputs:</strong></p><p>If any of its Tags to Attack are detected, moves toward and attacks the Avatar or Objects with its target Tags</p></td></tr></tbody></table>

<img src="/files/eWNaHhH15aJjjtbUi1m7" alt="" class="gitbook-drawing">

## Parameters

| Options                          | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](/files/2wzS5b70eLl4q0xROOqX) | <p><strong>Chasing Area</strong> - Determines the area within which the Object will chase its target.<br><br>This parameter is visualised with a blue cube Gizmo that adjusts as you enter new <mark style="color:red;"><strong>X</strong></mark>, <mark style="color:green;"><strong>Y</strong></mark>, and <mark style="color:blue;"><strong>Z</strong></mark> values.</p>                                                                                                                                                                                                                                                                                                                                                                                        |
| ![](/files/RWwE1LmcF3WCBVRZc9x9) | <p><strong>Attack Damage</strong> (slider) - Defines how many points of damage your Object will deal with a single hit.<br><br>The max value of this parameter is determined by the ASSET's <img src="/files/iKa3PpvEvOc6x99uKWBy" alt=""><mark style="color:yellow;">Power</mark> stat.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ![](/files/ThIVg1fu66JFkbIMdtQc) | **Tags to Attack** - Defines which tags the Object will chase and attack if within its range.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ![](/files/4WWpGlYZmv8miy0mYhlU) | <p><strong>Detection Range</strong> (slider) - defines the area in which your Object will detect <mark style="color:red;">tags to attack</mark>.<br><br>This parameter is visualised with a <mark style="color:yellow;"><strong>yellow</strong></mark> circle Gizmo that adjusts as you move the slider or change the value.<br><br>The max value of this parameter is determined by the ASSET's <img src="/files/WOhd9cNbt7aeAekBHnG2" alt=""><mark style="color:green;">Luck</mark> stat.<br><br><strong>Attack Range</strong> - Defines how far away the Object needs to be to attack.<br><br>This parameter is visualised with a <mark style="color:red;"><strong>red</strong></mark> circle Gizmo that adjusts as you move the slider or change the value.</p> |
| ![](/files/iIoWvl3CCPhpbUUJ3ObE) | <p><strong>Max Hunger</strong> - The maximum hunger value that can be reached by the Object. When the predator is hungry, it will attack <mark style="color:orange;">Tags to Attack</mark>.<br><br><strong>Food Value</strong> - Determines the amount of hunger your Object earns from eating a target.<br><br><strong>Hunger Decrease Rate</strong> - How much hunger your Object loses automatically per second.<br><br><strong>Eating Duration</strong> - The time, in seconds, that it takes for the Object to eat a target.</p>                                                                                                                                                                                                                               |


---

# 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://docs.sandbox.game/en/creator/game-maker/docs/behaviours/npc-ai-pawns/predator.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.
