Quick Start

This section will guide you through setting up and implementing the Adaptive Recoil & Spread plugin in your project.

Quick Start Guide

1. Create Required Assets

First, create the pattern assets you'll need:

  1. In the Content Browser, right-click and select Recoil & Spread → Recoil Pattern

  1. Name it appropriately (e.g., "RP_AssaultRifle")

  2. Right-click again and select Recoil & Spread → Spread Pattern

  3. Name it (e.g., "SP_AssaultRifle")

2. Set Up Your Weapon Actor

If you already have a weapon actor, add the ARS Weapon Component to it. Or you can just add to your character it is depend on your code and structure:

  1. Open your weapon Blueprint

  2. Click the Add Component button

  3. Search for "ARS Weapon Component" and add it

  4. In the Details panel, assign your created Recoil Pattern and Spread Pattern assets

For C++ example; you can add your weapon component to your weapon base:

// Example C++ code for setting up a weapon with ARS
#include "Components/ARSWeaponComponent.h"

UCLASS()
class AMyWeapon : public AActor
{
    GENERATED_BODY()
    
public:
    AMyWeapon()
    {
        // Create component
        ARSWeaponComponent = CreateDefaultSubobject<UARSWeaponComponent>(TEXT("ARSWeaponComponent"));
    }
    
    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Weapon")
    UARSWeaponComponent* ARSWeaponComponent;
};

3. Basic Pattern Configuration

Configuring a Recoil Pattern:

  1. Double-click your Recoil Pattern asset to open the custom editor

  2. Click the "Add Point" button to create points in the pattern

  3. Arrange the points to create your desired recoil path

  4. Adjust point properties in the Details panel

  5. Save the asset when finished

Recoil Pattern Editor

Configuring a Spread Pattern:

  1. Double-click your Spread Pattern asset to open the editor

  2. Adjust the spread curve to define how spread increases with continuous fire

  3. Set base spread values and recovery rates

  4. Configure spread modifiers as needed

  5. Save the asset

Spread Pattern Editor

4. Setup Player Controller

  1. As the last step, we need to add the "ARSRecoil Spread Manager Component" to the player controller.

ARS Recpil Spread Manager Component

5. Testing Your Setup

  1. Create a test map or use an existing one

  2. Place your weapon in the level or equip it to a character

  3. Play the game and fire the weapon to observe recoil and spread

  4. Use the debug visualization options in the ARS Weapon Component to see patterns in real-time

  5. Adjust your patterns based on observed behavior

Next Steps

After completing this basic setup, you can:

  • Fine-tune your recoil and spread patterns

  • Add modifiers to adjust behavior based on game conditions

  • Implement more advanced features like aim-down-sight modifications

  • Create different patterns for various weapons

Last updated