⚙️
FPS Framework
Asset StoreFab
  • Get Started
    • Welcome!
    • Setup
  • Tutorials
    • Character
      • First-Person Controller
      • Inventory
      • Firearm
        • Basics
        • Advanced
        • Other
          • Spray pattern
          • Attachment System
          • Projectile System
      • Explosive
    • Systems
      • Audio System
      • Animation System
      • Interactions
        • Pickable
      • Save System
      • Settings System
    • Tools
      • Extension Methods
    • UI
      • FPS Counter
      • Get Name
      • Image Size Fitter
  • Other
    • Full Change Log
      • 2025 Change Log
      • 2024 Change Log
      • 2023 Change Log
      • 2022 Change Log
Powered by GitBook
On this page

Was this helpful?

  1. Tutorials
  2. Character
  3. Firearm
  4. Other

Spray pattern

A scriptable object that represents the spray pattern of the firearm.

PreviousOtherNextAttachment System

Last updated 1 month ago

Was this helpful?

A spray pattern is preset data for the firearm that helps improve the player's muscle memory. As players use the weapon more, they learn the spray patterns, making the game easier to master.

To create a spray pattern, start by opening the Create Asset menu. Right-click in the Project window, then go to Akila > FPS Framework > Weapons > Spray Pattern. This will generate a new spray pattern asset, and here's what you should see once it's created:

Fields

Name
Description

Total Amount

The power of the spray pattern determines how wide the spray is. The higher the value, the wider the spray will be, causing the bullets to spread more. A lower value results in a more concentrated spray.

Passive Multiplier

The minimum spray represents the starting point for the bullet spread. As you shoot, the spray increases, causing the bullets to spread more. When you stop shooting, the spray resets back to this minimum value, helping to control the weapon's accuracy.

Ramp-Up Time

The time taken to go from the maximum spray to the minimum spray. Determines how quickly the bullet spread resets after you stop shooting. A shorter time will cause the spread to return to the minimum quickly, while a longer time will make the reset slower.

Is Randomized

If the spray pattern is not randomized, the curves will be used instead to define the bullet spread. When the spray pattern is randomized, the spread will vary with each shot based on the pattern data.

Vertical recoil

Refers to the upward movement of the firearm when firing, typically caused by the force of the shot.

Horizontal recoil

refers to the sideways movement of the firearm when firing, typically caused by the force of the shot.

To use the spray pattern, assign it to the "Spray Pattern" or "Aim Spray Pattern" field in the firearm preset of your gun.

Newly created spray pattern