Recoil parameters are defined in the RecoilAnimData — a Scriptable Object that you can create via right-click ▸ Create ▸ KINEMATION ▸ Procedural Recoil ▸ Recoil Data:
Recoil Anim Data properties.
Recoil targets
Smoothing
Layers
Miscellaneous
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 the maximum value is in [Z;W] range.Aim Rot and Aim Loc define multipliers for each rotation and translation. Applied when aiming.
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 is a continuous 2D movement that simulates inaccuracy when firing.
Noise X/Y - max and min values for position offsets along X and Y axes (right and up movement).
There are 4 Vector curves in the data asset. Each curve animates the rotation or translation when auto or single firing.
Example semi curves.
All curves must start and end with zero.
Here’s the difference between auto and semi curves:
Auto curve
Semi curve
Curves are almost identical. The only difference is that the Auto curve value is very close to zero at some point. This point is the delay between shots.
For example, a fire rate of 600 RPM has a delay of 0.1 seconds between shots. All auto curves must be close to 0 at 0.1 seconds.
When auto or burst mode is enabled, the curve length is set to the fire delay. The auto or burst curve is cropped to the delay between shots.
Add the Recoil Animation component to the character’s prefab and apply the changes. Then, add a Modify Bone modifier to the Procedural Animation settings and bind the recoil OutRot and OutLoc values:
Modify Bone and Recoil Animation.
⌘I
Assistant
Responses are generated using AI and may contain mistakes.