# Glide

## Overview

The Glide State allows the character to glide (Fall gracefully). Its State [**ID** ](/animal-controller/scriptable-architecture/scriptables/scriptable-ids.md#states-ids)is **11.**&#x20;

![](/files/IjdF0OyFTTrZEkH8crGK)

![](/files/vKUVQV9lqg2TqRcjfHoo)

## Creating the Glide State

To create a new Glide State. use the Plus \[+] button on the States list

![](/files/1UvvdXJfauEKq3WQ8DZa)

Or just duplicate any of the already created Glide States Assets of any character you own and drag it to the States List.

## Priority

The state should have a higher priority than [**Idle**](/animal-controller/main-components/manimal-controller/states/idle.md), [**Locomotion** ](/animal-controller/main-components/manimal-controller/states/locomotion.md)and [**Fall**](/animal-controller/main-components/manimal-controller/states/fall.md). but below [**Death**](/animal-controller/main-components/manimal-controller/states/death.md)**,** since the animal can be killed at any time.

![](/files/Ki8kel8GECRgaNau6q0v)

When the animal is in this state, all the Lower priorities states are ignored until the[ **exit conditions**](/animal-controller/main-components/manimal-controller/states/fly.md#exit-conditions) for this state are fulfilled.&#x20;

## Requirements

The State **requires** an Empty Transform set as a [**Rotator**](/animal-controller/main-components/manimal-controller/advanced.md)**.** This Rotator is in charge of the  Pitch and Bank rotation of the animal while gliding.

![](/files/uL9mf4j5EPCu2dRLPvlw)

{% hint style="danger" %}

### Without setting this 'Rotator' gameObject on the Advanced tab the Glide State won't work properly

{% endhint %}

## Activation

This state mainly uses an Input value to be Activated.

### By Input

When Pressing the Input Value for Glide

![](/files/i99EhaL4ZNirZBJpuaIJ)

This will be connected automatically with the state if the state has the same value for its Input.

![](/files/zL0WOIicHULdybPl1EkX)

### Using a Zone

A Zone can activate the Gliding state.

![](/files/8fWvWqp2Bw4LTaaN7Kon)

### Using a Reaction

Animal Reactions can be used to activate the state. Check [**Reactions**](/animal-controller/main-components/reactions.md)

## Exit Conditions

Internally, the exit conditions will be executed to check if the State can exit. In the case of this state the **conditions** are:

* The animal is Gliding near the ground so he can land (when **Can Land** is enable)
* The Input for fly is released (when the **Glide Input** is set to **pressed**)
* The Input for fly is toggled to off (when the **Glide Input** is set to **toggle**)
* A Higher priority State is Activated. (E.g. The animal glide toward the water)
* MAnimal.State\_AllowExit() is called.

## General

![](/files/FSlgAi6DdFQY7KOPG7AZ)

### ID

Glide. Its value is 11

### Enter Input

Input to Activate is set to **Glide.** This should match the Input set on the Malbers/MInput Component

## Tags

![](/files/WtNmj5CAPfqPM3s2x2g8)

MAIN TAG \[Glide]

* **Input: "**&#x46;ly"
* **General**
  * **RootMotion** = True
  * **Sprint** = false
  * **Gravity** = false
  * **Grounded** = false
  * **Custom Rotation** = false
  * **Orient to Ground** = false
  * **Ignore Lower States** = true
  * **Persistent**  = false
  * **Lock Movement** = false
  * **Lock Input** = false
  * **Additional Position Speed** = true
  * **Additional Rotation Speed** = True
  * **Free Move** = true

## Limits

Limit the State to be activated when any of the conditions on this section is valid.

In the case of the Glide State, this should be only activated when the Fall State is Active.

![](/files/hwXMTjCCGtuqUvVpWFki)

You can add more limitations if you need.

## Animator

The Fly state requires an Animation State that is in charge of the Glide movement.&#x20;

![Its transition conditions is \[State = 11\] \[StateOn\]](/files/09xVMtf0n97LGZqQgIeF)

All states have a core animation state. For glide is a blend tree with the Tag **Glide.**

![](/files/UUXc0hQTnZZpPrb53GbG)

Since the State is a moving state, the Speed Multiplier must be set as **Parameter** "**SpeedMultiplier**"

{% hint style="info" %}
Glide Enter Animation is Optional
{% endhint %}

This Blend Tree is usually set this way:

![](/files/Wg9EMtRmiAIWgWGQ9N85)

You can use a simplified version with just one animation instead of using a blendtree.

## Speed Set

The Glide needs a new [**Speed Set**](/animal-controller/main-components/manimal-controller/speeds.md) that affects the Glide State

![](/files/120d9zMVCgQnDDMuyCvx)

{% hint style="success" %}
If your Glide animations are **NOT** RootMotion or they don't have the movement and turning speed you desire, then you need to **increase** the [Position ](/animal-controller/main-components/manimal-controller/speeds.md#position)and [Rotation ](/animal-controller/main-components/manimal-controller/speeds.md#rotation)values to be **greater** than zero
{% endhint %}

![](/files/IrE1BkeOwQerychmCHGW)

## Glide Parameters

![](/files/qDFmfPqcNTQf626YwVFy)

### Gravity Drag

How much Drag will be applied to the Glide State

![Left: 3                         Right: 1.5](/files/HbNe4V3qOkkqIyxCqcum)

### Bank

Bank Rotation when turning left and right

![Left: 60                                                      Right: 20](/files/WsU4k277C8y38IFCFsBV)

### Pitch Limit

Forward Pitch Rotation when is gliding forward

![Left 60                                    Right 20](/files/1oJctOgZg2ULPFs7h9YE)

### Bank Strafe

Bank Value if Strafe with this State is activated

### Pitch Strafe

Pitch Value if Strafe with this State is activated

### Inertia Lerp

When Entering the Glide State... The animal will keep the Velocity from the last State if this value is greater than zero

### Always Forward

The animal will move forward while Gliding, without the need to push the W Key, or Move forward Input

### Use Camera Input

The animal will change the Camera Input while the Animal is using this State

### Landing on Layer

Layers to Land on

### Check Land Distance

Ray Length multiplier to check for ground near. This value needs to be greater than Land Distance

### Land Distance

Minimum Land Distance to Land Automatically

### Lower Blend Land Distance

Minimum Ground Distance to Change the State Float Value to 0

### Lerp Distance

Value to Lerp the State Float value


---

# 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/main-components/manimal-controller/states/glide.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.
