⚙️
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
  • Creating an Explosive
  • Triggering
  • Triggering With Damage
  • Triggering After Delay
  • Adding Effects
  • Other
  • Type Differences
  • Audio Effects

Was this helpful?

  1. Tutorials
  2. Character

Explosive

A detailed guide on how to use and setup the explosive.

PreviousProjectile SystemNextSystems

Last updated 1 month ago

Was this helpful?

Creating an Explosive

Explosives rely on the Explosive component to handle all explosion-related functionality, including force, damage, visual effects, and more. To create a new explosive, either drag and drop your explosive model into the scene or create an empty GameObject to serve as its base.

You can find all default explsive barrels at FPS Framework > Art > Models > Props

Since this is a new GameObject, it won't have any components by default—unless it's a model, which may come with some. To make the explosive functional, begin by adding the Explosive component to the GameObject.

To begin adjusting the explosion range and debugging, scroll to the bottom of the Explosive component and enable the Debug option. Then, activate Ranges and Rays to visualize the explosion parameters in the scene.

The red range represents the Death Range, which you can find at the top of the Explosive component. Any object within this range will have its health instantly set to 0. The blue range applies damage based on the distance between the explosion center and the target—closer targets receive more damage.

The damage range applies damage based on the value set in the Damage field of the Explosive component. The closer an object is to the explosion's center, the more damage it receives, up to the maximum defined by this field.

Triggering

At this stage, the explosive is set up and capable of dealing damage, but it won’t detonate on its own—it needs a trigger.

Triggering With Damage

To make the explosive react to bullets or other damage sources, enable the Damageable option in the Explosive component. This allows it to explode when it takes damage.

Once the Damageable option is enabled, the explosive will take damage from any weapon or damaging source. If its health reaches zero—whether from gunfire or nearby explosions—it will automatically detonate.

Triggering After Delay

To make the explosive detonate after a delay, similar to a triggered grenade:

  1. Enable Explode After Delay In the Explosive component, check the Explode After Delay option.

  2. Set the Delay Time Adjust the delay time at the top of the Explosive component to determine how long after activation the explosion will occur.

This will trigger the explosion automatically when the game starts, with the specified delay before detonation.

Adding Effects

To add an explosion effect that spawns when the explosive detonates:

  1. Assign Explosion Effect In the Explosive component, locate the Explosion field.

  2. Link the Effect Drag and drop the desired explosion effect (such as a particle system or prefab) into the Explosion field.

This will ensure the explosion effect is triggered when the explosive detonates.

You can find default explosion effects at FPS Framework > Prefabs > Particle Systems

The same steps apply to adding a Crater Decal, with a slight difference in how it spawns:

  1. Assign Crater Decal In the Explosive component, locate the Crater Decal field.

  2. Link the Decal Drag and drop the desired crater decal (usually a burned ground effect) into the Crater Decal field.

  3. Spawning Behavior The crater decal will be spawned on the bottom surface of the explosion, creating a realistic burned ground effect where the explosion occurs.

You can find default Crater Decal effect at FPS Framework > Prefabs >Explosive

Other

Type Differences

The explosive also offers additional features to enhance its functionality, such as the Explosive Type setting. There are two types available:

  1. Ray Tracking In this mode, the explosion casts a ray from its center to the target hittable object. If the ray detects any obstacles within the defined Hittable Layers that block the path, it will ignore the hit. This makes it ideal for more precise explosions where you want to account for barriers or cover.

  2. Standard The standard type bypasses the ray detection and damages everything within the explosion's radius, regardless of any obstacles in the way. This results in a more straightforward and indiscriminate explosion effect.

Both types allow you to customize how explosions interact with the environment, giving you greater control over gameplay dynamics.

Audio Effects

This explosive also includes an additional feature that temporarily muffles the player's hearing after detonation. This effect reduces the sound levels for a fixed duration before returning to normal.

By default, this feature is enabled in all default explosives, but it is disabled in the Explosive component itself by default. To activate it, simply enable the Muffle Hearing option in the Explosive component.

Default expslove black barrel