# Auto-Axis

## Auto-Axis Position

ShakeFX already supports distance-based attenuation. But what about taking the source direction relative to the listener into account? We can use the axis between the source and the listener to displace the camera position.

This is particularly effective for 2D games, where bouncing the camera away from the source of the shake really enhances the effect.

You can set this up by selecting a **1 Axis** motion on a `Vector3` property and setting the **Axis Mode** to **Auto**:

<figure><img src="/files/Phwcfcp17tCtdh6NzsYt" alt="" width="375"><figcaption></figcaption></figure>

#### Axis Mode

* **Local Space:** Auto-axis is disabled, the user specifies an axis in the local space of the shake target.
* **Auto:** The axis of the shake is determined by the position of the listener relative to the source.
* **Auto With Aspect Ratio:** The axis of the shake is determined by the position of the listener relative to the source. It is further adjusted by the camera aspect ratio, which can feel more natural.

## Auto-Axis Rotation

We could apply the same principle to rotation as well by rotating the camera away from the source of the shake. This would be particularly useful in a 3D context. This is not implemented yet but we're working on it.


---

# 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://fx-engine.gitbook.io/shakefx/core/auto-axis.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.
