# URecoilAnimationComponent

This is the core element of the plugin - this component procedurally creates recoil animations, based on the given animation data.

## Public Methods

***

```cpp
void Init(const FRecoilAnimData Data, const float Rate, const int Bursts = 0)
```

Initializes current recoil animation data. Should be called when a weapon is equipped.

***

```cpp
void Play()
```

Plays recoil animation. Should be called **every** shot.

***

```cpp
void Stop()
```

Stops playing recoil animation.

***

```cpp
void SetFireMode(EFireMode NewMode)
```

Updates current fire mode. The PRAS supports 3 fire mods: semi, burst, and auto.

{% hint style="info" %}
**Tip:** there's no difference between burst and auto for the system. Both of the cases are handled identically.
{% endhint %}

***

```cpp
float GetDelta() const
```

Returns the time since the last shot.

***

```cpp
void Simulate(bool bStartSim)
```

Starts playing simulation weapon recoil.

***

```cpp
void ShowUI()
```

Adds Helper UI to the viewport.

***

```cpp
void HideUI()
```

Removes Helper UI from the viewport.

***

```cpp
void SaveData()
```

Saves current animation data with the given SlotName.

***

```cpp
void SetAimingStatus(bool bStatus)
```

Updates aiming state. Enables a second set of values, used for the ADS mode only.

***

```cpp
FORCEINLINE FTransform GetOutput() const
```

Returns the output recoil animation.

***

```cpp
void ScaleInput(FInputScale_PRAS NewScale)
```

Applies target values scaling. Call this when a new attachment is added.

***

```cpp
void UnscaleInput(FInputScale_PRAS NewScale)
```

Disabled target values scaling. Call this when an attachment is detached.

***

```cpp
void ResetInputScale()
```

Disables input scaling, meaning that the target values are not changed.

***

```cpp
void AddEvent(float Time, FOnTimelineEvent Event);
```

Adds an event to the recoil timeline. Useful for camera shakes, that depend on a particular animation time. Make sure to bind events in BeginPlay.

***


---

# 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://hitmans-store.gitbook.io/pras-documentation/fundamentals/types/urecoilanimationcomponent.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.
