🔫
PRAS Documentation
  • 👋Welcome!
  • Tutorial
    • 🌟Getting Set Up
      • 🦾Character Setup
      • 🔶Animation Blueprint
  • Fundamentals
    • 🔥Recoil Animation
    • 📈Curve Extractor
    • 📑Types
      • URecoilAnimationComponent
      • FAnimNode_RecoilAnimation
      • Recoil Data
Powered by GitBook
On this page
  1. Fundamentals
  2. Types

URecoilAnimationComponent

Module: RecoilAnimation\Public\RecoilAnimationComponent.h

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

Public Methods


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.


void Play()

Plays recoil animation. Should be called every shot.


void Stop()

Stops playing recoil animation.


void SetFireMode(EFireMode NewMode)

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

Tip: there's no difference between burst and auto for the system. Both of the cases are handled identically.


float GetDelta() const

Returns the time since the last shot.


void Simulate(bool bStartSim)

Starts playing simulation weapon recoil.


void ShowUI()

Adds Helper UI to the viewport.


void HideUI()

Removes Helper UI from the viewport.


void SaveData()

Saves current animation data with the given SlotName.


void SetAimingStatus(bool bStatus)

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


FORCEINLINE FTransform GetOutput() const

Returns the output recoil animation.


void ScaleInput(FInputScale_PRAS NewScale)

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


void UnscaleInput(FInputScale_PRAS NewScale)

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


void ResetInputScale()

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


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.


PreviousTypesNextFAnimNode_RecoilAnimation

Last updated 1 year ago

📑