# Recoil Pattern Parameters

Below you can find the main parameters of the recoil pattern

* **RecoilSpeed** - Recoil application speed
* **ShotsSpreadCurve** - Additional camera offset for each shot The offset is randomized in the range \[-x:-y, x:y] for each shot Curve Time - shot number Curve values X, Y - camera offset Curve value Z - not used;
* **ShotsSpreadCurveCompensationCoeff** - "Normalize" the extra offset for each shot from @ShotsSpreadCurve Using this curve, you can control the amount of the next random when shooting depending on how much the current shot differs from the reference value (i.e. with 0 randomness) Time - randomness value of the previous shot (value from 0 to 1, where 0 is no randomness, and 1 is the maximum randomness) Value - decreasing coefficient of the randomness of the current shot (0 - no randomness for the current shot, 1 - unchanged for the current shot);
* **bEnableMaxRecoilCameraRotation** - If true, enable @MaxRecoilCameraRotation
* **MaxRecoilCameraRotation** - Max camera offset
* **BehaviorOnLimitUnitsReached** - Type of behavior when reaching the limit of shots in the pattern
* **bEnableRelaxationOnlyAfterEndShooting** - Enabling relaxation only after the end of shooting. Otherwise activated after each shot
* **RecoilRelaxationWaitingTime** - Time that must elapse after the shot end of shooting to activate relaxation
* **bEnableRelaxation** - If true, enable relaxation. Relaxation - return of the camera rotation to the initial position, which was before the start of shooting
* **MaxRelaxationValueUnits** - Unit type @MaxRelaxationPitchValue
* **RelaxationSpeed** - Relaxation application speed
* **bEnableMaxRelaxationPitchValue** - If true, enable MaxRelaxationPitchValue
* **MaxRelaxationPitchValue** - Maximum relaxation value (when it is reached, relaxation is disabled)
* **bWaitEndRecoilToActivateRelaxation** - If true, waiting for the end of the application of recoil to start relaxation
* **bEnableMinRecoilToActivateRelaxation** - If true, enable MinRecoilPitchToActivateRelaxation
* **MinRecoilPitchToActivateRelaxation** - Minimum camera offset (as a result of recoil) to activate relaxation
* **StopRelaxationByPlayerInputType** - Conditions for stopping relaxation as a result of input from the user
* **StopRelaxationByPlayerInputPitchValue** - The minimum input from the user to stop the relaxation (For example: mouse movement or touch)
* **RecoilModifiers** - Utilities for modifying recoil in runtime



Listing with types and specifiers ue4

```
/*
 * Recoil application speed
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Recoil")
FRTInterpolationSpeed RecoilSpeed;

/*
 * Additional camera offset for each shot
 * The offset is randomized in the range [-x:-y, x:y] for each shot
 * Curve Time - shot number
 * Curve values X, Y - camera offset
 * Curve value Z - not used
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Recoil")
UCurveVector* ShotsSpreadCurve = nullptr;

/*
* "Normalize" the extra offset for each shot from @ShotsSpreadCurve
* Using this curve, you can control the amount of the next random when shooting
* depending on how much the current shot differs from the reference value (i.e. with 0 randomness)
* Time - randomness value of the previous shot (value from 0 to 1, where 0 is no randomness, and 1 is the maximum randomness)
* Value - decreasing coefficient of the randomness of the current shot (0 - no randomness for the current shot, 1 - unchanged for the current shot)
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Recoil")
UCurveFloat* ShotsSpreadCurveCompensationCoeff = nullptr;

/*
 * If true, enable @MaxRecoilCameraRotation
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Recoil", meta = (InlineEditConditionToggle))
bool bEnableMaxRecoilCameraRotation = false;

/*
 * Max camera offset
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Recoil", meta = (EditCondition = "bEnableMaxRecoilCameraRotation"))
FRotator MaxRecoilCameraRotation = FRotator::ZeroRotator;

/*
 * Type of behavior when reaching the limit of shots in the pattern
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Recoil")
ERTBehaviorOnLimitUnitsReached BehaviorOnLimitUnitsReached = ERTBehaviorOnLimitUnitsReached::Repeated;

/*
 * Enabling relaxation only after the end of shooting. Otherwise activated after each shot
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Relaxation|Activation")
bool bEnableRelaxationOnlyAfterEndShooting = false;

/*
 * Time that must elapse after the shot / end of shooting to activate relaxation
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Relaxation|Activation", meta = (UIMin = "0", ClampMin = "0"))
float RecoilRelaxationWaitingTime = 1.f;

/*
 * If true, enable relaxation. Relaxation - return of the camera rotation to the initial position, which was before the start of shooting
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Relaxation")
bool bEnableRelaxation = true;

/*
 * Unit type @MaxRelaxationPitchValue
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Relaxation", meta = (EditCondition = "bEnableMaxRelaxationPitchValue"))
ERTMaxRelaxationValueUnits MaxRelaxationValueUnits = ERTMaxRelaxationValueUnits::RecoilPercent;

/*
 * Relaxation application speed
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Relaxation")
FRTInterpolationSpeed RelaxationSpeed;

/*
 * If true, enable @MaxRelaxationPitchValue
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Relaxation")
bool bEnableMaxRelaxationPitchValue = false;

/*
 * Maximum relaxation value (when it is reached, relaxation is disabled)
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Relaxation", meta = (UIMin = "0", ClampMin = "0", EditCondition = "bEnableMaxRelaxationPitchValue"))
float MaxRelaxationPitchValue = 1.f;

/*
 * If true, waiting for the end of the application of recoil to start relaxation
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Relaxation|Activation")
bool bWaitEndRecoilToActivateRelaxation = false;

/*
 * If true, enable @MinRecoilPitchToActivateRelaxation
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Relaxation|Activation", meta = (InlineEditConditionToggle))
bool bEnableMinRecoilToActivateRelaxation = false;

/*
 * Minimum camera offset (as a result of recoil) to activate relaxation
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Relaxation|Activation", meta = (EditCondition = "bEnableMinRecoilToActivateRelaxation"))
float MinRecoilPitchToActivateRelaxation = 0.f;

/*
 * Conditions for stopping relaxation as a result of input from the user
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Relaxation|Cancellation")
ERTStopRelaxationByPlayerInputTypes StopRelaxationByPlayerInputType = ERTStopRelaxationByPlayerInputTypes::StopByInputInOppositeDirection;

/*
 * The minimum input from the user to stop the relaxation (For example: mouse movement or touch)
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Relaxation|Cancellation")
float StopRelaxationByPlayerInputPitchValue = 1.f;

/*
 * Utilities for modifying recoil in runtime
 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced, Category = "Modifiers")
TArray<URTRecoilPatternModifier*> RecoilModifiers;
```
