> For the complete documentation index, see [llms.txt](https://kinemation.gitbook.io/scriptable-animation-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinemation.gitbook.io/scriptable-animation-system/recoil-system/recoil-pattern.md).

# Recoil Pattern

## Properties

**Recoil Pattern** represents the controller recoil, which is added to the character and camera rotation. This type of recoil is controller by the player, so it has a practical purpose.

The recoil is generated in a standalone component, make sure to add it to your character:

<figure><img src="/files/2y8lY4kFgH7if0jJ3YRB" alt="" width="383"><figcaption><p>Recoil Pattern.</p></figcaption></figure>

**Recoil Settings** define the actual recoil properties, such as damping, randomized targets for vertical/horizontal recoil, etc.

**Delta Look Input Property** represents the delta input value, which is related to the User Input Controller component we added previously in [Components](/scriptable-animation-system/workflow/components.md)section.

Let's take a look at the **Recoil Settings**:

<figure><img src="/files/wJP52b0jthzeyguMmNkh" alt="" width="368"><figcaption><p>Recoil Pattern settings.</p></figcaption></figure>

**Horizontal/Vertical Recoil** defines the randomized range.

**Horizontal/Vertical Smoothing** define the interpolation speed.

**Damping** defines how fast we should return to the initial screen position.

## Integration

To add the recoil to your controller, make sure to grab a reference to the **Recoil Pattern** component first.

Then, make sure to access the component and add the recoil to the player inut:

```csharp
if (_recoilPattern != null)
{
    _playerInput.y += deltaMouseY;
    _playerInput += _recoilPattern.GetRecoilDelta();
}
```

Then, call the *Init* method when a gun is equipped:

```csharp
_recoilPattern.Init(recoilPatternSettings);
```

Finally, call the *OnFireStart* and *OnFireStop* methods:

```csharp
_recoilPattern.OnFireStart(); // Call every shot.
```

```csharp
_recoilPattern.OnFireEnd(); // Call when firing is cancelled.
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://kinemation.gitbook.io/scriptable-animation-system/recoil-system/recoil-pattern.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
