# Wall Module

This system includes:

* Wall detection
* Wall sliding
* Smooth wall slide movement
* Wall jumping
* Directional wall jump forces
* Input locking after wall jump

The module is designed to create responsive and polished platformer movement.

***

## Component

```
WallModule
```

***

## Responsibilities

The Wall Module controls:

* Wall detection
* Slide movement while touching walls
* Wall jump behavior
* Air movement after wall jumps
* Movement direction locking

It works together with:

* Rigidbody2D
* CollisionDetector
* PlayerInputHandler

***

## Inspector Settings

## Wall

### Is Enabled

Enables or disables the Wall Module.

| Setting    | Description                         |
| ---------- | ----------------------------------- |
| Is Enabled | Enables wall movement functionality |

Useful for:

* Testing
* Mechanic customization
* Gameplay restrictions

***

## Wall Slide

<figure><img src="/files/tCdADjIwmiT460QCLuuA" alt="" width="296"><figcaption></figcaption></figure>

Wall Slide slows the player's fall speed while touching a wall.

This creates:

* More controlled movement
* Better platforming precision
* Improved wall jump timing

***

## Wall Slide Speed

Controls the maximum downward speed while wall sliding.

| Setting          | Description                             |
| ---------------- | --------------------------------------- |
| Wall Slide Speed | Maximum falling speed during wall slide |

Lower values:

* Create slower slides
* Increase player control

Higher values:

* Create faster wall movement

Recommended Range:

```
1 – 4
```

***

## Wall Slide Smoothing

Smooth Wall Slide gradually slows the player's fall speed instead of instantly changing velocity.

This creates:

* Smoother movement
* More polished wall interaction
* Better visual feel

***

## Use Smooth Wall Slide

Enables smooth velocity interpolation while wall sliding.

| Setting               | Description                     |
| --------------------- | ------------------------------- |
| Use Smooth Wall Slide | Enables smooth slide transition |

***

## Wall Slide Smooth Speed

Controls how quickly the slide speed adjusts.

| Setting                 | Description                |
| ----------------------- | -------------------------- |
| Wall Slide Smooth Speed | Smooth interpolation speed |

Higher values:

* Faster response
* Snappier movement

Lower values:

* Softer movement transitions

Recommended Range:

```
5 – 12
```

***

## Wall Jump

<figure><img src="/files/BQvPYaUsaSI0O3wiOAIY" alt="" width="240"><figcaption></figcaption></figure>

Wall Jump launches the player away from the wall.

The system uses directional jump force for:

* Horizontal push
* Vertical lift

This creates responsive aerial movement.

***

## Wall Jump Force

Controls the wall jump launch strength.

| Axis | Description             |
| ---- | ----------------------- |
| X    | Horizontal launch force |
| Y    | Vertical launch force   |

Example:

```
X = 10
Y = 14
```

This creates:

* Strong horizontal push
* High vertical jump

Recommended Range:

```
X = 6 – 14
Y = 10 – 18
```

***

## Wall Jump Lock Time

Temporarily locks player movement after a wall jump.

This helps:

* Prevent instant direction reversal
* Improve movement consistency
* Create cleaner wall jump behavior

| Setting             | Description                         |
| ------------------- | ----------------------------------- |
| Wall Jump Lock Time | Input lock duration after wall jump |

Recommended Range:

```
0.1 – 0.3
```

***

## Face Opposite On Wall Jump

Automatically flips the player away from the wall after jumping.

| Setting                    | Description                          |
| -------------------------- | ------------------------------------ |
| Face Opposite On Wall Jump | Flips player direction automatically |

Recommended:

```
Enabled
```

This creates:

* More natural movement
* Cleaner animation direction
* Better visual feedback

***

## Recommended Settings

## Responsive Platformer

| Setting                 | Value |
| ----------------------- | ----- |
| Wall Slide Speed        | 2     |
| Wall Slide Smooth Speed | 8     |
| Wall Jump Force X       | 10    |
| Wall Jump Force Y       | 14    |
| Wall Jump Lock Time     | 0.2   |

***

## Precision Platformer

| Setting                 | Value |
| ----------------------- | ----- |
| Wall Slide Speed        | 1.5   |
| Wall Slide Smooth Speed | 10    |
| Wall Jump Force X       | 8     |
| Wall Jump Force Y       | 12    |
| Wall Jump Lock Time     | 0.15  |

***

## Dependencies

Required Components:

* Rigidbody2D
* CollisionDetector
* PlayerInputHandler

Required Setup:

* WallCheck Transform
* Wall Layer

***

## Notes

* Proper WallCheck placement is important for stable wall detection
* Smooth Wall Slide improves perceived polish significantly
* Wall Jump Lock Time helps prevent movement instability
* Wall Jump Force should be balanced with Jump Force settings

***

## Common Setup Tips

* Position the WallCheck slightly in front of the player collider
* Use lower Wall Slide Speed for more controlled movement
* Increase Wall Jump X force for wider jumps
* Enable Smooth Wall Slide for better game feel
* Keep Wall Jump Lock Time short for responsive controls

***

## What's next?

{% content-ref url="/pages/dwFYNaCsnrZd6yObQ5VI" %}
[Movement Module](/pro-2d-controller-doc/core-module/movement-module.md)
{% endcontent-ref %}

{% content-ref url="/pages/Hk1xCtMVNoNuiJpCzKwm" %}
[Jump Module](/pro-2d-controller-doc/core-module/jump-module.md)
{% endcontent-ref %}

{% content-ref url="/pages/a3VkV5ZsLnOF8QKW1NaN" %}
[Dash Module](/pro-2d-controller-doc/core-module/dash-module.md)
{% endcontent-ref %}

{% content-ref url="/pages/A0dIPEOCcdKfsOKLI8cZ" %}
[Ledge Module](/pro-2d-controller-doc/core-module/ledge-module.md)
{% endcontent-ref %}


---

# 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://the-code-cm.gitbook.io/pro-2d-controller-doc/core-module/wall-module.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.
