🔫
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
  • How does it work?
  • How do curves work?
  1. Fundamentals

Recoil Animation

In this section you will learn how the system works in details

PreviousAnimation BlueprintNextCurve Extractor

Last updated 1 year ago

How does it work?

The recoil is generated in , which uses VectorCurve assets and to generate recoil.

The idea behind the whole system is based on the interpolation between the 0 and Target Values based on the custom curve:

RecoilValue = Lerp(0f, TargetValue, CurveValue)

CurveValue is not clamped in [0;1] range, which gives us the possibility to achieve that bouncy and springy motion without using spring interpolation. This solution is frame-rate independent, and much more intuitive and easier to use rather than simple interpolation.

How do curves work?

You probably noticed that there're quite a lot of slots for curves - you only need to use the Single and Auto slots!

Tip: Rest slots are legacy slots, which are no longer required, and exist for backward compatibility.

Let's take a closer look at the curves:

As you can see the Auto curves are very close to zero at some point. This point is the time delay between shots.

Example: let's say the weapon fire rate is 600 RPM, this means the delay between shots is 60 / 600 = 0.1s. This means that Auto curves should be very close to zero around 0.1s to achieve smooth results.

Another important aspect is that all curves start and end with zero.

🔥
URecoilAnimationComponent
Recoil Stored Data Assets
So many curves