Recoil Animation
In this section you will learn how the system works in details
Last updated
In this section you will learn how the system works in details
Last updated
The recoil is generated in URecoilAnimationComponent, which uses VectorCurve assets and Recoil Stored Data Assets 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.
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.