# Dash Module

<figure><img src="/files/oneD24aLBif2cQCjUjpm" alt="" width="563"><figcaption></figcaption></figure>

This system is designed to create responsive and impactful movement while remaining highly customizable.

The Dash Module supports:

* Directional dash movement
* Dash cooldowns
* Gravity control during dash
* Air dashing
* Dash freeze effects

***

## Component

```
DashModule
```

***

## Responsibilities

The Dash Module controls:

* Dash velocity
* Dash timing
* Dash cooldown
* Gravity behavior during dash
* Air dash support
* Dash freeze effects

It works together with:

* Rigidbody2D
* PlayerInputHandler
* CollisionDetector

***

## Inspector Settings

## Dash

### Is Enabled

Enables or disables the Dash Module.

| Setting    | Description                |
| ---------- | -------------------------- |
| Is Enabled | Enables dash functionality |

Useful for:

* Testing
* Temporary gameplay states
* Mechanic customization

***

## Dash Speed

Controls how fast the player moves during a dash.

| Setting    | Description            |
| ---------- | ---------------------- |
| Dash Speed | Dash movement velocity |

Higher values:

* Create faster dashes
* Increase movement distance

Lower values:

* Create shorter controlled dashes

Recommended Range:

```
15 – 30
```

***

## Dash Duration

Controls how long the dash lasts.

| Setting       | Description          |
| ------------- | -------------------- |
| Dash Duration | Dash active duration |

Longer durations:

* Increase dash distance
* Feel smoother

Shorter durations:

* Feel snappier
* Create precise movement

Recommended Range:

```
0.1 – 0.3
```

***

## Dash Cooldown

Controls how long the player must wait before dashing again.

| Setting       | Description          |
| ------------- | -------------------- |
| Dash Cooldown | Delay between dashes |

Recommended Range:

```
0.5 – 1.5
```

***

## Behavior

The Behavior section controls how the player behaves while dashing.

***

## Disable Gravity During Dash

Temporarily disables gravity while dashing.

| Setting                     | Description                 |
| --------------------------- | --------------------------- |
| Disable Gravity During Dash | Removes gravity during dash |

Enabled:

* Creates cleaner dash movement
* Prevents downward pull

Disabled:

* Dash follows normal gravity

Recommended:

```
Enabled
```

***

## Allow Air Dash

Allows the player to dash while airborne.

| Setting        | Description              |
| -------------- | ------------------------ |
| Allow Air Dash | Enables airborne dashing |

Enabled:

* Adds advanced movement options
* Improves aerial control

Disabled:

* Dash only works while grounded

***

## Dash Freeze

Dash Freeze creates a short pause before the dash begins.

This effect adds:

* Impact
* Game feel
* Stronger dash feedback

Commonly used in:

* Action platformers
* Precision movement systems

***

## Use Dash Freeze

Enables or disables dash freeze behavior.

| Setting         | Description             |
| --------------- | ----------------------- |
| Use Dash Freeze | Enables pre-dash freeze |

***

## Dash Freeze Time

Controls how long the freeze lasts before the dash starts.

| Setting          | Description                 |
| ---------------- | --------------------------- |
| Dash Freeze Time | Freeze duration before dash |

Lower values:

* Faster dash startup

Higher values:

* More dramatic dash impact

Recommended Range:

```
0.03 – 0.08
```

***

## Recommended Settings

## Responsive Platformer

| Setting                     | Value   |
| --------------------------- | ------- |
| Dash Speed                  | 20      |
| Dash Duration               | 0.2     |
| Dash Cooldown               | 1       |
| Disable Gravity During Dash | Enabled |
| Allow Air Dash              | Enabled |
| Dash Freeze Time            | 0.05    |

***

## Fast Action Platformer

| Setting                     | Value   |
| --------------------------- | ------- |
| Dash Speed                  | 28      |
| Dash Duration               | 0.15    |
| Dash Cooldown               | 0.5     |
| Disable Gravity During Dash | Enabled |
| Allow Air Dash              | Enabled |
| Dash Freeze Time            | 0.03    |

***

## Dependencies

Required Components:

* Rigidbody2D
* PlayerInputHandler
* CollisionDetector

***

## Notes

* Dash Freeze greatly improves perceived game feel
* Disabling gravity during dash creates cleaner movement
* Air Dash can significantly increase movement freedom
* Shorter dash durations create more responsive gameplay

***

## Common Setup Tips

* Use lower Dash Duration for tighter platforming
* Combine Dash Freeze with particles for stronger feedback
* Keep Dash Cooldown balanced to avoid movement spam
* Use Air Dash carefully in precision platformers

***

## 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/kInZPCp4z8AXp1gru01o" %}
[Wall Module](/pro-2d-controller-doc/core-module/wall-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/dash-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.
