# Mantle Component

## Overview

This component is used to climb obstacles. Add it directly to your character:

<figure><img src="https://1415000928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUAC5B06XWM8YyqQzyIP2%2Fuploads%2FFXw5rJcCtIINED09vTZK%2Fimage.png?alt=media&#x26;token=446b3b11-6fb4-4ca4-a315-947be9c283d5" alt="" width="434"><figcaption><p>Inspector</p></figcaption></figure>

**Mantle High** - *Motion Warping Asset* for climbing high obstcales.

**Mantle Low** - *Motion Warping Asset* for climbing low obstacles.

**Settings** is a *Data Asset*, which defines the settings for climbing:

<figure><img src="https://1415000928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUAC5B06XWM8YyqQzyIP2%2Fuploads%2FL5FoUtBwEoRo7elhdiEN%2Fimage.png?alt=media&#x26;token=f0843906-f139-4c24-85e5-247ca818dea5" alt="" width="410"><figcaption><p>Mantle Settings.</p></figcaption></figure>

{% hint style="success" %}
**Tip:** you can create Mantle Settings and Motion Warping Assets by right clicking <mark style="background-color:purple;">**Create/KINEMATION/Motion Warping/**</mark>
{% endhint %}

* **Layer Maks:** defines the collision mask.
* **Max Height:** maximum allowed height. If obstacle's height is greater than this value, climbing won't be performed.
* **Low Height:** required height to use high-climbing asset. If the obstacle height is great than this value, the system will use the Climb High Asset.
* **Min Height:** minimum allowed height. If obstacle's height is less than this value, climbing won't be performed.
* **Max Distance:** max allowed distance between the character and obstacle.
* **Capsule Radius/Height:** parameters for character capsule trace. It will be used to find the obstacle and check if the obstacle's edge has enough space to place the character.
* **Sphere Edge Check Radius:** defines radius for sphere trace, which will be used to find obstales edge.
* **Max Surface Incline Angle:** defines the maximum allowed surface incline angle.
* **Forward Offset:** defines the forward offset from the target point.

## How does it work?

To initiate an interaction, make sure to get a reference to the **MantleComponent** in your code. Then, use the **Interact** method of the **MotionWarping** component:

```csharp
_warping.Interact(_mantleComponent);
```

**MantleComponent** uses 3 stages to deteremine the target obstacle point:

1. Try to find the obstacle using the **Capsule** properties and **Max Distance**.
2. Try to find the edge by using **Sphere Check** properties, max and min obstacle height properties.
3. Check if point has enough space for the character.

If all steps return true, the system will begin interaction.&#x20;

## Motion Waring Asset Requirements

Usually climbing is about going from A to B, so make sure to have only 1 Warp Phase in your asset:

<figure><img src="https://1415000928-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUAC5B06XWM8YyqQzyIP2%2Fuploads%2F78SVKxQnZwmTa6ve5o5F%2Fimage.png?alt=media&#x26;token=2f33d188-556d-421b-8202-3d04ded218e5" alt="" width="427"><figcaption></figcaption></figure>
