🪂Glide

Overview

The Glide State allows the character to glide (Fall gracefully). Its State ID is 11.

Creating the Glide State

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

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, Locomotion and Fall. but below Death, since the animal can be killed at any time.

When the animal is in this state, all the Lower priorities states are ignored until the exit conditions for this state are fulfilled.

Requirements

The State requires an Empty Transform set as a Rotator. This Rotator is in charge of the Pitch and Bank rotation of the animal while gliding.

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

Activation

This state mainly uses an Input value to be Activated.

By Input

When Pressing the Input Value for Glide

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

Using a Zone

A Zone can activate the Gliding state.

Using a Reaction

Animal Reactions can be used to activate the state. Check Reactions

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

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

MAIN TAG [Glide]

  • Input: "Fly"

  • 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.

You can add more limitations if you need.

Animator

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

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

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

Glide Enter Animation is Optional

This Blend Tree is usually set this way:

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

Speed Set

The Glide needs a new Speed Set that affects the Glide State

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 and Rotation values to be greater than zero

Glide Parameters

Gravity Drag

How much Drag will be applied to the Glide State

Bank

Bank Rotation when turning left and right

Pitch Limit

Forward Pitch Rotation when is gliding forward

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

Last updated