# Slope Limit Behaviour

## Description

The `SlopeLimitBehaviour` component allows us to define the walk-able behavior of an object as a whole, rather than on a per-face basis. When enabled, it permits us to override the `CharacterMovement` `slopeLimit` property, providing greater flexibility.

This is particularly useful in cases where we want to constrain (or permit) specific objects or zones to a particular behavior, regardless of their slope limit value. For instance, marking other characters as non-walk-able, preventing a player character from landing on them.

To utilize this feature, add the `SlopeLimitBehaviour` to the `GameObject` with your `Collider`. Then, in the `CharacterMovement` component, make sure to set the `slopeLimitOverride` property to true.

## Enums

```csharp
/// <summary>
/// The slope behaviour for attached collider.
/// </summary>

public enum SlopeBehaviour
{
    Default,

    /// <summary>
    /// Sets the collider as walkable.
    /// </summary>

    Walkable,

    /// <summary>
    /// Sets the collider as not walkable.
    /// </summary>

    NotWalkable,

    /// <summary>
    /// Let you specify a custom slope limit value for collider.
    /// </summary>

    Override
}
```

## Properties

```csharp
/// <summary>
/// The current behaviour.
/// </summary>

public SlopeBehaviour walkableSlopeBehaviour

/// <summary>
/// The slope limit angle in degrees.
/// Only used on SlopeBehaviour.Override.
/// </summary>

public float slopeLimit

/// <summary>
/// The cosine of slope angle (in radians).
/// This is used for faster angle tests (e.g. dotProduct > slopeLimitCos)
/// </summary>

public float slopeLimitCos
```


---

# 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://oscar-gracian.gitbook.io/easy-character-movement-2/user-manual/general/components/slope-limit-behaviour.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.
