# Zones

## Overview

Zones are Triggers that Enable Logics on the Animal, like Jump, Actions, Deaths... etc. Once an animal Enters a Zone it can be activated via Input or Automatically.

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

## Requirements

* A zone requires any type of **collider** set as **Trigger.**

![](/files/-M5DhN52jUD5JGFDfxpy)

* The Layer set on the GameObject must be different from the Layers set on the [**Ground Layer**](/animal-controller/main-components/manimal-controller/general.md#ground-layer) in the Animal Controller. Usually is set as **Ignore Layer**

![](/files/-M5DhZAEILUPebrxvpqy)

{% hint style="danger" %}

### The Animal needs to have any type of collider and a rigid body to interact with the zone

{% endhint %}

## Properties

### Automatic

As soon as the animal enters the zone it will activate the zone logic. If set to false you need to manually call: Zone.Activate()

### Disable After Used

Disables the zone after it's used 1 time.

### Limit

How many characters can use this zone at the same time. If set to a negative value (-1) then it has no limit.

### Trigger

As above, which collider is the trigger for the zone to activate

### Layer

Which layer should be used to detect the animal

### Zone Type

A zone can modify a [**Mode**](/animal-controller/main-components/manimal-controller/modes.md), Force, [**State**](/animal-controller/main-components/manimal-controller/states.md)**,** or [**Stance**](/animal-controller/main-components/manimal-controller/stances.md) on an animal, depending the Action set in the Zone.

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

## **Type: Mode**

### **Mode ID**

Which Mode ID should activate

### **Ability Index**

Which ability should activate. See the [**Modes**](/animal-controller/main-components/manimal-controller/modes.md#abilities) documentation for more information

{% hint style="info" %}
When the [**Mode** ](/animal-controller/main-components/manimal-controller/modes.md)is Set to Action, the **Ability Index** Parameter it will automatically change to **Action ID** to help you better which [**Action Index**](/animal-controller/scriptable-architecture/scriptables/scriptable-ids.md#actions) to play on the Animal
{% endhint %}

### **Status**

How should the Mode be played?&#x20;

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

### Mode Power

Value assigned to the mode float value when using the zone

### Force Mode

Plays a mode no matter if a mode is already playing

## **Type: State**

When the Zone is set to [**State**](/animal-controller/main-components/manimal-controller/states.md)**,** The animal will automatically make an **State Action**  if it enters the Zone Trigge&#x72;**.**&#x20;

### **State ID**

ID of the State to modify e.g. Fly, Death etc.

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

### On Enter/Exit

The zone can have different enter and exit actions:<br>

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

### Activate

Activate a State on an Animal.

![Horse dies (Activates Death) when it touches the Death Zone Trigger](https://lh6.googleusercontent.com/t6CdKaeHo60lasyeFPHCXDgDqVAHk_okpUn_H60u0XMF4wwP956qBSHRyqn0FiBYsICjIlbhQanh5cTsGdB8LX0I411LAFrWWPv4WDmZAbGTd-MkqRUja9iM2pmZB5DdfrZA_Prj)

### Allow Exit

Some States cannot exit on their on because some conditions may need to be completed. Calling the Method: **State.AllowExit()** on the Animal permits the state to exit and other **states** with lower priority to try to activate themselves.&#x20;

For Example:  A character is Flying; then enters A **Fly State Zone** with **Allow Exit** set, this will allow other States like **Fall** to be activated since the **Fly** State is allowing lower priority states to be active.

![The Dragon Exit Fly when entering the Fly Zone with (AllowExit), allowing Fall State to be activated.](/files/-M5DssrBidNgGCxfvLj0)

### Force Activate

Some States **cannot** be activated on their on, because it may require some conditions to be completed. This action forces any state to be Active.&#x20;

E.g.: The Swim State can only be Activated if the animal touches the water. but it can be forced using this action.

### Disable

Disable a State on an Animal.&#x20;

E.g.: you can have a *Jump State Zone* to Disable the **Jump State** when a character enters a room.

### Enable&#x20;

If a State on an animal  is Disabled, it will enable it back.

E.g.: you can have a *Jump State Zone* to Enable the **Jump State** when a character exits a room.

### Set Exit Status

Sets the Exit status on the Animator to be true

## Type: Stance

When the Zone is set to [**Stance**](/animal-controller/main-components/manimal-controller/stances.md), The animal will automatically make an **Stance Action**  if it enters the Zone Trigge&#x72;**.**&#x20;

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

### **Stance ID**

ID of the Stance to modify.

### On Enter/On Exit

The zone can have different enter and exit actions.

### Activate

On **Entering** the Trigger Zone: the [**Current Stance**](/animal-controller/main-components/manimal-controller/stances.md#current-stance) on the Animal will be equal to the Zone [**Stance ID**](/animal-controller/secondary-components/zones.md#stance-id).

### Exit

On **Exiting** the Trigger Zone: the [**Current Stance**](/animal-controller/main-components/manimal-controller/stances.md#current-stance) on the Animal will be equal to the Zone [**Stance ID**](/animal-controller/secondary-components/zones.md#stance-id).

### Set Default

Set's the default stance to the stance specified in the StanceID

## Type: Force

<figure><img src="/files/4DQJMZEtopPWZAtxxnEM" alt=""><figcaption></figcaption></figure>

### Force

Amount of Force that gets applied to the animal

### Enter Acceleration

Acceleration to apply the force when the animal enters the zone

### Exit Drag

Set a value for the drag applied when the animal exits the zone

### Limit Force

Set a limit for the total amount of force to apply

### Air Control

Can the animal be controlled whilst in the air?

### Grounded

Changes if the animal is grounded when entering the force zone

## Other Parameters

### Weight

Probability to activate the zone when entering the zone 0 - 1. \
0 = 0%. 0.5 = 50%, 1 = 100%.

### Angle

Limit the activation of the zone from certain angles only

### Reset on Active

Removes the stored Animal on the zone when the zone is activated, resetting it to it's default state

### Tags

Set this parameter only if you want the zone to activate with certain gameobjects with tags.

### Bone Only

Activate when a bone enters the zone. The bone needs it's own collider.

### Bone Name

Name of the bone to check if Bone Only is true.

## Events

### On Animal Enter Zone

Invoked when the Animal Enters the Zone Trigger

### On Animal Exit Zone

Invoked when the Animal Exits the Zone Trigger

### On Zone Active

Invoked when the Animal Activates the Zone

### On Zone Failed

Invoked when the zone fails to activate for whatever reason e.g. the wrong animal walks into it


---

# 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://malbersanimations.gitbook.io/animal-controller/secondary-components/zones.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.
