# Wall Run

## Overview

The Wall Run State allows the character to run on Vertical surfaces. Its State [**ID** ](/animal-controller/scriptable-architecture/scriptables/scriptable-ids.md#states-ids)is **12.**&#x20;

<figure><img src="/files/WYJdX8Jp9uNqMDn3Qeq6" alt=""><figcaption></figcaption></figure>

## Creating the Wallrun State

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

<figure><img src="/files/1MnQIZ0NkD3Ta4lWcl65" alt=""><figcaption></figcaption></figure>

Or duplicate any of the already created Wall Run 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. Set it above states that will not be interrupted when is active.

<figure><img src="/files/jEI3QDtLaXw6dltw7iuP" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Multiple States can have the same priority. Wall Run and Jump can be activated and interrupt each other.
{% endhint %}

When the animal is in this state, all the Lower priorities states are ignored until the **Exit conditions** for this state are fulfilled.&#x20;

## Requirements

The state requires Vertical surfaces to be tagged as "WallRun"  or math the Parameter **Tag**

<figure><img src="/files/F8kAnkXiwBleGSDC06FY" alt=""><figcaption></figcaption></figure>

* The Animal Requires to have the **Rotator** GameObject already set.

## Activation

The State uses raycasting to find nearby vertical surfaces tagged as "WallRun". If any of the raycasts touches any colliders (left or right) then the state can be successfully activated.

<figure><img src="/files/GkWjNhkgdTIpgqt89yH0" alt=""><figcaption></figcaption></figure>

### **Automatic**

When enabled, if one of the wall rays touches any collider, the state will activate.

### By Input

When Pressing the Input Value for WallRun; E.g. Jump Input

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

<figure><img src="/files/IzRgeIbvFZzL3bzH6fts" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/P0wuF02t9P9CuaPk7MxK" alt=""><figcaption></figcaption></figure>

### Using a Zone

A Zone can activate the 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 Wall Run the conditions are:

* State Duration time has elapsed:

<figure><img src="/files/LsNGKD977R8zXTKuaxzt" alt=""><figcaption><p>The wall run will be active for only 2 seconds, then it will allow other states to try to activate themselves (e.g. Fall will activate after) </p></figcaption></figure>

* There's no more wall to Run.

<figure><img src="/files/dIa4F1k2LEs3pXAELmJq" alt=""><figcaption></figcaption></figure>

* The Exit Input was pressed

<figure><img src="/files/RhNwDWPlOjhEMuufDzwo" alt=""><figcaption></figcaption></figure>

* The character is grounded or it has touched the ground

<figure><img src="/files/ooAX43DxSoT5ADoBRx8t" alt=""><figcaption><p>The Ground Raycast was activated because the character was too close to the ground</p></figcaption></figure>

## Animator

### Wall Run Substate Machine

The Wall Run requires an Animation State that is in charge of the Wall Run movement.&#x20;

<figure><img src="/files/TE2KWGk8mObTPK4SYp3Z" alt=""><figcaption><p>The Transition Enter Condition of this state is State=12</p></figcaption></figure>

### Enter Transition

<figure><img src="/files/83MxrgpJHDotTN1G51um" alt=""><figcaption><p>State = 12 ID of Wall run</p></figcaption></figure>

### Animation States (Core Animations)

The animations required for the Wall Run are 2.. Run in the **Left** side and Run in the **Right** side

<figure><img src="/files/DewvJRom7RVF14fcBIcR" alt=""><figcaption></figcaption></figure>

* **Right** Transition Condition is **`State Enter Status = 1`**
* **Left** Transition Condition is **`State Enter Status = 0`** (Default Transition)

{% hint style="info" %}
Core animations must have the Stae **Tag** properly set
{% endhint %}

<figure><img src="/files/217tvXkHieJzGG3vNUnb" alt=""><figcaption></figcaption></figure>

## WallRun Parameters

<figure><img src="/files/RigObVcTg2TgbaRLe0Kh" alt=""><figcaption></figcaption></figure>

### Automatic

The state will use the Rays to activate the state as soon as it finds a wall.

### Input Pressed

The State will keep its activation as long as the Input is pressed. If the Input is released the State will end.

### Pivot Center

Position Value to Cast the Wall Rays

<figure><img src="/files/kiTXucxnylX7ABObKLSY" alt=""><figcaption></figcaption></figure>

### Wall Check

Length of the Wall RayCasts

### Wall Distance

How far or close from the wall the character will be during the wall run.

<figure><img src="/files/SJydWm9RvI0Uhi0X3cSo" alt=""><figcaption><p>Look at the hand Placement of the character.</p></figcaption></figure>

### Start Height

Height from the ground needed to activate the wall run. This is used so the character does not accidentally touch a Wall and activates the state, and right after deactivate it because is close to the ground.

### Layer

Layer to check what colliders will be used for the State. By Default is set to "Default"

### Wall Tag

GameObjects Tag to check what objects will be used for the State. By Default is set to "WallRun"

### Align Lerp

Lerp Value to Position the character correctly on the Wall. Higher values it will snap the character to the wall

### Rotation Lerp

Lerp Value to Orient the character correctly on the Wall. Higher values it will orient faster the character to the wall

### Bank

Extra angle to orient the character to the wall.&#x20;

<figure><img src="/files/ayJ6ybzwFowN7I8pii7v" alt=""><figcaption></figcaption></figure>

### Exit Angle

This will force the Character to Exit in an Angle when the State Exit. This allows to Give an angle&#x20;

### Exit Angle Time

Time to apply the Impulse/

### Push States

If the next state is on this list. E.g. (Jump or Fall) the Exit Impulse and Angle will be applied.

This helps the character to separate from the wall (Jumping to another Wall)

### Gravity Push

Value to drag the character Down when its on the wall Run. Set it to zero to to ignore gravity

<figure><img src="/files/nvcjJnK7RpYap2pIaMFi" alt=""><figcaption></figcaption></figure>

### Up Drag

Inherit Up Movement From the last state (E.g. Jump)

<figure><img src="/files/ImPLUm9pboDC1O04R1jb" alt=""><figcaption></figcaption></figure>


---

# 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/wall-run.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.
