🧗Wall Run

1.4.2b

Overview

The Wall Run State allows the character to run on Vertical surfaces. Its State ID is 12.

Creating the Wallrun State

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

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, Locomotion and Fall. but below Death, since the animal can be killed at any time. Set it above states that will not be interrupted when is active.

Multiple States can have the same priority. Wall Run and Jump can be activated and interrupt each other.

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 Vertical surfaces to be tagged as "WallRun" or math the Parameter Tag

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

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.

Using a Zone

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

  • State Duration time has elapsed:

  • There's no more wall to Run.

  • The Exit Input was pressed

  • The character is grounded or it has touched the ground

Animator

Wall Run Substate Machine

The Wall Run requires an Animation State that is in charge of the Wall Run movement.

Enter Transition

Animation States (Core Animations)

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

  • Right Transition Condition is State Enter Status = 1

  • Left Transition Condition is State Enter Status = 0 (Default Transition)

Core animations must have the Stae Tag properly set

WallRun Parameters

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 Wall RayCasts

Wall Distance

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

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.

Exit Angle

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

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

Up Drag

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

Last updated