> For the complete documentation index, see [llms.txt](https://hitmans-store.gitbook.io/pras-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hitmans-store.gitbook.io/pras-documentation/fundamentals/types/urecoilanimationcomponent.md).

# 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.

***
