---
description: 1.4.5 (IN Process)
---

# Wall Run Vertical

## Overview

The Wall Run Vertical State allows the character to run on Walls like Prince of persia. Its State [**ID** ](../../../../scriptable-architecture/scriptables/scriptable-ids#states-ids)is **15.**&#x20;

## Creating the Wall Run Vertical  State

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

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2Fe1qr6tPJr2OlG53qPT7y%2Fimage.png?alt=media&#x26;token=dc7221f3-0825-485a-b226-2f68eb154283" 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**](idle), [**Locomotion** ](locomotion)and [**Fall**](fall). but below [**Death**](death)**,** since the animal can be killed at any time. Set it above states that will not be interrupted when is active.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FBlgEUqYEUZV1WFU74Qf4%2Fimage.png?alt=media&#x26;token=ce0f24ac-bca2-4253-b641-914618be19f4" 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 match the Parameter **Tag**

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2Fg8DvQi3VFZ9LYl1AiyJu%2Fimage.png?alt=media&#x26;token=c5fd6651-e8e8-4349-8d5b-759ee85e6e1d" alt=""><figcaption></figcaption></figure>

* The character requires to have the **Rotator** GameObject already set.

## Activation

The State uses raycasting to find a front vertical surface to activate it.

### Activations Conditions

* A raycast will be cast forward from the character  and the the wall needs to be tagged as **"WallRun"**   (optional)
* The wall needs to be set on the given layer
* Input Sprint needs to be active (optional)

### **Automatic**

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

### 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="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FSRYUS4JX33DUwMSmayhS%2Fimage.png?alt=media&#x26;token=f23d82de-0407-4eb4-80a2-97a0abecadd5" alt=""><figcaption></figcaption></figure>

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FN92eFpTubl5tQwHt1mTy%2Fimage.png?alt=media&#x26;token=ba949e96-be31-44c7-812b-dc76cb5405e0" alt=""><figcaption></figcaption></figure>

### Using a Zone

A Zone can activate the state.

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FdDVTVyt9jMPCEzUENaZv%2Fimage.png?alt=media\&token=b6b066c0-c2eb-4639-9b9e-a9463c0af84e)

### Using a Reaction

Animal Reactions can be used to activate the state. Check [**Reactions**](../../reactions)

## 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="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FzCplv72pAiTl1v1rJuPD%2Fimage.png?alt=media&#x26;token=d7365a41-60fa-4980-9c32-7d5f5d572a70" 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="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2F6H2EEwrw5jhk4nbmtdco%2FUnity_6P561t3bIH.gif?alt=media&#x26;token=6c515f5e-81e4-485c-9740-8f4c7d46022b" alt=""><figcaption></figcaption></figure>

* The Exit Input was pressed.

## 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="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FLAK4kJz6BiFXin8CrBdN%2Fimage.png?alt=media&#x26;token=f379c466-da03-4db5-af38-5bb661e13932" alt=""><figcaption><p>The Transition Enter Condition of this state is State=12</p></figcaption></figure>

### Enter Transition

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2F9bbRWkfZF4C1orfr2tH6%2Fimage.png?alt=media&#x26;token=4efa2ea0-a5ac-4d5f-8a1f-1bdb1e269200" 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="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2F4EiS50uIEV3HCfXlXaWW%2Fimage.png?alt=media&#x26;token=b129d881-f29b-4f30-b658-79138ea48d70" 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="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2Fa3XMjmyOeXZ3UnMA46qJ%2Fimage.png?alt=media&#x26;token=555422bc-a454-4442-a4a1-86dce068a38b" alt=""><figcaption></figcaption></figure>

## WallRun Parameters

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FpOmG3elMEnmx37ZglJVQ%2Fimage.png?alt=media&#x26;token=3ee566aa-b66d-441a-8571-009739c8e9fc" 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

### Wall Check

Length of the RayCast to find a front wall

### Wall Distance

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

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2Ff5QEWqgwMxzEh01DKVXQ%2FUnity_eCgNh1izJC.gif?alt=media&#x26;token=6a25a76f-634f-4dc4-be9b-d9c7a40bdde1" 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="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FaGzmPqOBAep8PgbDuYpG%2FUnity_qwEXR0sbww.gif?alt=media&#x26;token=b79214d8-e733-491b-af3c-c1af1185342c" 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="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2F0I2AZd5nh0ti3Fi9KCUS%2FUnity_y1heOA240Y.gif?alt=media&#x26;token=8c71eadb-d6f5-4080-ad56-feb04bf4106b" alt=""><figcaption></figcaption></figure>

### Up Drag

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

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FFWMviCFL3hq7KXGAWsMU%2FUnity_zxMQAmrHFH.gif?alt=media&#x26;token=dbef73bc-e371-4698-b8c5-6ddd1cb957ad" alt=""><figcaption></figcaption></figure>





