docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Creating a Custom Weapon

    In this tutorial, we will create a custom weapon by modifying an existing one. We will turn the standard Grenade Launcher into a burst-fire weapon.

    1. Create the Weapon Prefab

    1. Navigate to the Assets > Shooter > Prefabs > Weapons folder.
    2. Duplicate the Weapon_GrenadeLauncher prefab
    3. Rename the new prefab to Weapon_GrenadeLauncher_Custom.

    2. Customize the Weapon Logic

    1. Open the Weapon_GrenadeLauncher_Custom prefab.
    2. Select the "Weapon" object in the Hierarchy.
    3. In the Inspector, locate the Modular Weapon component.
    4. Under Modular Behaviors, change the Firing Mechanism to BurstMechanism.

    This will automatically add the BurstMechanism component to your weapon.

    1. Locate the Burst Mechanism component in the Inspector.
    2. Update the settings to the following values:
      • Shots Per Burst: 5
      • Time Between Shots: 0.03
      • Cooldown After Burst: 0.03
      • Allow Continuous Bursts: Unchecked

    3. Create the Weapon Data

    1. In the same folder (Assets > Shooter > Prefabs > Weapons), find WeaponData_GrenadeLauncher.
    2. Duplicate it and rename the copy to WeaponData_GrenadeLauncher_Custom.
    3. Select the new asset and in the Inspector, change the Weapon Name to "My Custom Weapon".

    4. Add to Modular Weapon

    1. Select the Weapon_GrenadeLauncher_Custom prefab.
    2. In the Inspector, locate the Modular Weapon component.
    3. Under Modular Behaviors, change the Weapon Data to WeaponData_GrenadeLauncher_Custom.

    You now have a custom burst-fire weapon prefab!

    5. Add to Loadout

    Now we need to add this weapon to the player's starting loadout.

    1. Navigate to Assets > Shooter > Data.
    2. Select the WeaponLoadout asset.
    3. In the Inspector, click the + button under Weapons to add a new slot.
    4. Add your new weapon to the loadout.

    6. Test the Weapon

    1. Open the [BB] Shooter scene.
    2. Enter Play Mode.
    3. Cycle through your weapons to find My Custom Weapon.
    4. Test out the new burst fire mechanic!

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)