Recoil Layer

Basics

This layer is responsible for applying procedural recoil.

You don't have to set up anything in the layer itself, instead, we will prepare the Recoil Data Asset for your weapon.

Create a new Recoil Data Asset by right-clicking in any folder Create -> FPS Animator -> RecoilAnimData.

This is how the Recoil Asset looks like:

This asset contains animation curves and values for the recoil solver. Let's figure out how the curves work and how to prepare them.

Recoil curves

There're recoil curves for each translation and rotation axis, 6 curves in total:

Tip: all curves must start and end with zero!

Here's the difference between auto and semi curves:

Curves are almost identical, the only difference is that Auto curve value is very close to zero at some point - this point is the delay between shots.

Example: let's say our fire rate is 600 RPM, then the delay between shots is 0.1s. This means, that all auto curves must be close to 0 at 0.1s time.

Why is that?

This is required for the auto solver to work properly. Whne auto/burst mode is enbaled, the curve length is set to the fire delay (see our example above). So, the length of the auto or burst curve gets cropped to the fire delay between shots.

Recoil data

Let's break down some properties in Recoil Anim Data asset:

Rotation Targets

  • Pitch - max and min values for the pitch (up) rotation

  • Roll - max and min values for the roll rotation.

  • Yaw - max and min values for the yaw (right) rotation.

Roll and Yaw components are Vector4. That's because of the way random values are calculated:

Minimum value for Roll and Yaw is a random value in [X;Y] range, while maximum value is in [Z;W] range.

Aiming Multipliers

Aim Rot and Aim Loc define multipliers for each rotation and transaltion. Applied when aiming.

Auto/Bursts Settings

  • Smooth Rot/Loc - defines interpolation speed for rotation and translation. Not applied if 0.

  • Extra Rot/Loc - multipliers applied in auto/burst mode only.

Noise Layer

  • Noise X/Y - max and min values for position offsets along X and Y axes (right and up movement).

  • Noise Accel - acceleration speed.

  • Noise Damp - damping speed.

  • Noise Scalar - aiming multipler.

Pushback Layer

Applied on the first shot of the auto or burst fire mode.

  • Push Amount - maximum value of the pushback.

  • Push Accel - acceleration speed.

  • Push Damp - damping speed.

Misc

  • Smooth Roll - if enabled, the sign of a random value for roll will change every shot.

  • Play Rate - the speed of the recoil animation.

Last updated