> For the complete documentation index, see [llms.txt](https://tvitchi-vfx.gitbook.io/air-dash-and-double-jump-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tvitchi-vfx.gitbook.io/air-dash-and-double-jump-documentation/documentation.md).

# Documentation

## Air Dash & Double Jump FX - Documentation

This guide focuses on adding the included effects to a character that already exists in your project. It covers the effect controller and its settings; it does not explain how to build a character or configure a movement controller.

### 1. Requirements

* Unity 6 (the project was created with Unity `6000.0.71f1`).
* Universal Render Pipeline (URP).
* Visual Effect Graph.
* Input System.

Install missing packages through **Window > Package Manager**. The package includes 20 dash graphs in `VFX effects/Air Dash`, 25 impact graphs in `VFX effects/Impacts`, and five demo scenes in `Maps`.

### 2. Add the Effects to an Existing Character

1. Open the scene or prefab containing your character.
2. Keep the character's existing movement and animation setup. The included effect controller does not move the character or replace its movement script.
3. Make sure the character has a **Character Controller**, then add `AirDashController` to that same GameObject.
4. Create or reuse child GameObjects for the effects. Add a **Visual Effect** component to each and assign one of the included VFX Graph assets.
5. In `AirDashController`, enable the effect slots you want and assign the corresponding Visual Effect components:
   * **Air Dash**: choose a graph from `VFX effects/Air Dash`.
   * **Double Jump**, **Fall Impact**, and **Jump Impact**: choose graphs from `VFX effects/Impacts`.
6. If the character already uses a different jump key, set **Double Jump > Activation Key** to the key used by its movement setup. The controller detects keyboard input itself, so its key must match the key that actually triggers the character's second jump.
7. If using Fall Impact, ensure the floor has non-trigger colliders and include their layers in **Ground Layers**.

The Visual Effect objects can be children of the character or live elsewhere in the scene. The controller binds their position to the character when a graph uses a Transform Binder or exposes transform properties. Assign each effect slot a separate Visual Effect component where possible; reusing the same component can cause one trigger to reinitialize another effect.

### 3. Connect the Included VFX Graphs

The supplied graphs are intended to be assigned and used; normally you do not need to create a new graph.

* Check the graph's event names and set the matching **Start Event** in the controller. The default is `OnPlay`; names are case-sensitive.
* Air Dash can also send a **Stop Event** (default `OnStop`) to stop further emission. The graph must handle that event for it to have an effect.
* Transform binding is optional. If a graph uses a **VFX Transform Binder**, the controller assigns its target every frame. Otherwise it updates exposed `Transform_position`, `Transform_angles`, and `Transform_scale` properties when present.
* **Transform Target** sets the shared binding target. If empty, the character's Transform is used. A Fall Impact graph using `Transform_position` is positioned at the bottom of the Character Controller.
* **Character Mesh** is an optional Skinned Mesh Renderer assigned to graphs that expose a `CharacterMesh` property.
* Optional bool properties are only set when a graph exposes the property with the matching name and type: `DashActive` is true while Air Dash is active; `DoubleJumpMode` is true during double-jump mode.
* The controller can activate an assigned effect GameObject and Visual Effect component when triggered, then restores their original active/enabled state after five seconds. Keep the component assigned and its graph set.

#### Optional: Using a Custom Graph

You can use your own VFX Graph instead of a supplied one. Add a Visual Effect component, assign the graph, and make sure it handles the start event configured in the relevant effect slot. For Air Dash, add handling for the configured stop event if emission should stop when the dash ends. Transform binders and the optional properties above are only needed if your custom graph uses them.

### 4. Configure AirDashController

`AirDashController` requires a Character Controller on the same character GameObject. It listens for keyboard input and observes grounding; it does not call or replace the character's movement script. Make sure the configured keys agree with the inputs that make the character jump.

#### Air Dash

* **Air Dash**: Enable or disable this effect slot.
* **Visual Effect**: Visual Effect component containing the dash graph.
* **Activation Key**: `Space` starts Air Dash with the primary jump. A different key starts it while airborne. `None` disables the non-Space key trigger.
* **Start Delay (s)**: Delay between activation and the start event (0-1 seconds).
* **End Anticipation (s)**:
  * Positive: stop before a predicted landing by this many seconds.
  * Zero: stop when landing is detected.
  * Negative: stop this many seconds after landing.
* **Unlimited Duration**: If enabled, the effect runs until its landing condition stops it. If disabled, it is also stopped at the maximum duration.
* **Max Duration (s)**: Time limit when Unlimited Duration is disabled (0.1-5 seconds).
* **Start Event**: Existing event in the graph that starts the effect (default `OnPlay`).
* **Stop Event**: Existing event in the graph that stops further emission (default `OnStop`).
* **Active Bool Property**: Optional graph bool set during the dash (default `DashActive`).

#### Double Jump

* **Double Jump**: Enable or disable this effect slot.
* **Visual Effect**: Visual Effect component containing the graph.
* **Start Event**: Existing graph event sent when a double jump is detected (default `OnPlay`).
* **Activation Key**: Key used to detect the double jump while airborne (default `Space`). It must match the character's double-jump input.
* **Mode Bool Property**: Optional graph bool set while the character is in double-jump mode (default `DoubleJumpMode`).

#### Fall Impact

* **Fall Impact**: Enable or disable this effect slot and landing prediction.
* **Visual Effect**: Visual Effect component containing the graph.
* **Start Event**: Existing graph event sent when the effect triggers (default `OnPlay`).
* **Single Jump Anticipation (s)**: Timing for a fall after a primary jump.
* **Double Jump Anticipation (s)**: Timing for a fall after a detected double jump.
* **Only After Jump**: If enabled, do not trigger when the character simply falls off a ledge.
* **Only After Double Jump**: If enabled, trigger only after a double jump.
* Positive anticipation values trigger before predicted ground contact; zero triggers on landing; negative values delay the effect until after landing. Both values are clamped to -0.5 to 1 second.
* **Ground Layers**: Layers used for grounding and landing prediction. Include the floor and other surfaces that should count as ground.

#### Jump Impact

* **Jump Impact**: Enable or disable the effect at the primary jump.
* **Visual Effect**: Visual Effect component containing the graph.
* **Start Event**: Existing graph event sent at the primary jump (default `OnPlay`).

#### Shared Targets

* **Character Mesh**: Optional Skinned Mesh Renderer passed to compatible graphs.
* **Transform Target**: Optional target for VFX Transform Binders and exposed transform properties. If empty, the character Transform is used.

### 5. Test and Troubleshoot

1. Enter Play mode and use your existing character controls to jump, double jump, and land.
2. By default, pressing Space for the primary jump starts Air Dash and triggers Jump Impact. A double jump is detected when the configured Double Jump key is pressed while airborne.
3. Test Fall Impact with the desired anticipation values and jump restrictions.
4. If an effect does not play, check that its slot is enabled, the Visual Effect component and graph are assigned, and the configured start event exists with the exact spelling and capitalization.
5. If Air Dash does not stop emitting, check that the graph handles the configured stop event.
6. If an effect is positioned incorrectly, inspect its Transform Binder or exposed `Transform_*` properties and set **Transform Target**.
7. If landing prediction fails, check the Character Controller, the ground colliders, and **Ground Layers**.
8. If the controller does not detect a jump, check that its activation key matches the key used by the existing character controls. `AirDashController` reads keyboard input directly.

The demo scenes can be used to preview the supplied graphs and controller behavior before assigning effects to your own character.
