# Wander Area

## Overview

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FDib2k2BE29gQRrmVBzQh%2Fimage.png?alt=media&#x26;token=3c14dd41-fcba-4fdb-9655-dd4bd0422215" alt=""><figcaption></figcaption></figure>

The wander area is a improved version of the Waypoint. the Difference is that it uses an Area to find the next position to go to, and it can transition to itself

{% embed url="<https://streamable.com/ogp1fz>" %}

{% hint style="info" %}
You can also use nested wander areas to have different shapes besides Box and Circle
{% endhint %}

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FmPT9KL3ewg29STFgJzgq%2Fimage.png?alt=media&#x26;token=fc41326f-e997-4466-baf4-f0da43d404b4" alt=""><figcaption><p>Nested wander area's</p></figcaption></figure>

## How to use it

Add the Wander Area to your AI Control Target Parameter and that should be it.

{% embed url="<https://streamable.com/n1mjs2>" %}

## Parameters

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FQnFQBfMbPUV5Zoebz9wC%2Fimage.png?alt=media&#x26;token=1d77b761-a94f-4196-9e86-17ac32c7975e" alt=""><figcaption></figcaption></figure>

### Point Type

This will establish if this area is on the Ground, Air, Water, or Underwater. Air types will activate the Fly State, UnderWater will activate the underwater State.

### Height

Default height for the waypoints. This parameter is used for the Look At Decision in the Brain Component. So the LookAt Ray is not pointing directly to the ground.

### Stopping Distance

Min Distance that the Ai Animal will stop when Arrives at the waypoint.

### Slowing Distance

Distance to start slowing its speed when arriving to this gameobject. If set to 0 or lower than the stopping distance, the slowing movement logic will be ignored

### Wait Time

Maximum and Minimum wait time needed to wait before choosing the next waypoint

### Area Type

Use a Circle or a Box area.

### Radius (For Circle)

Radius of the circle area

### Box Area (For Box)

A Vector3 which determines the box dimensions

### Wander Weight

Probability of keep wondering on this same Wander Area. Meaning the next waypoint will be itself.

### Next Waypoints

List of next waypoints to go to.

## Events

### On Target Arrived

Invokes when a target arrives to this wander area
