Overview
The Barrage system is a system that fires extremely lightweight bullets with only the minimum required functionality, using the dedicated execution action “Fire Barrage Bullet (FireBarrageBullet)”.
It is capable of firing hundreds of bullets at once, but its functionality is highly limited. You cannot assign visual scripts to the bullets themselves, nor can you animate them.
Contact with barrage bullets can only be detected through the dedicated condition “Collide With Barrage Bullet (CollideWithBarrageBullet)”.
They cannot be detected using conventional attack collision detection or wall collision detection.
For bullets that require complex behavior, please use the conventional “Fire Bullet” action instead.
What You Can Do with “Fire Barrage Bullet”
- Choose the firing type from Omnidirectional, Rapid Fire, or Shotgun.
- Specify the firing origin.
- Specify a firing target.
- Choose post-fire behavior from Straight, Curved, Direction Change, Split, or Homing.
- Specify the bullet sprite.
- Bullets automatically rotate based on their movement direction, treating 0 degrees (right) as the forward direction.
- Specify bullet speed, including acceleration and deceleration after firing.
- Specify hitbox size and collision layers.
- Specify bullet attack power and attributes
(however, damage processing is not handled automatically and must be set up manually).
Examples of Creating “Barrage Patterns”
“Flower Pattern”
Generate multiple bullets simultaneously using Omnidirectional + Curved bullets.
By setting opposing curve angles—such as +0.3 degrees for one bullet and –0.3 degrees for another—you can create a clean, flower-like pattern.
Adding rotation will turn it into a washing-machine-like pattern.
“Grid Pattern”
Use multiple Rapid Fire + Straight bullets and shift the firing origin offsets.
Adding direction changes or splitting can create interesting variations.
“Player-Targeted”
Set the player as the target.
By applying offsets, you can create bullets that intentionally miss the player (“aim-off” bullets), while adding homing behavior results in predictive, lead-style bullets.
Barrage and Scripting
Bullets generated by the Barrage system cannot have scripts attached to them.
Instead, all behavior is implemented through the script of the object that detects the collision, using the “Collide With Barrage Bullet” condition.
What You Can Do with “Collide With Barrage Bullet”
- Detect contact between an object’s HitArea and a barrage bullet’s hitbox.
Detection occurs when the HitArea2D layer mask matches the barrage bullet’s layer. - Remove the barrage bullet upon contact (useful for bombs or player damage).
- When a barrage bullet is removed, you can convert it—based on a specified probability—into another object or a Godot scene. This is mainly used for bombs.
- Store the contacted barrage bullet’s attack power and attribute into specified variables.
Practical Examples Using “Collide With Barrage Bullet”
“Bomb”
Create a game object with a HitArea whose layer mask matches the barrage bullet layer, equivalent to the bomb’s attack range.
(This is slightly complicated, but contact detection cannot be performed using AttackArea.)
Use visual scripting so that the HitArea becomes active only at the explosion timing and then disappears.
After the explosion, set a “Collide With Barrage Bullet” condition with the option to remove contacted barrage bullets enabled.
- When deleting barrage bullets with a bomb and spawning score items
Specify a drop item. Since this conversion process has a processing cost equivalent to normal game object generation, spawning many items at once can easily cause performance drops.
It is recommended to keep the drop rate low, such as 10%. - When also dealing damage to enemies with the bomb
Simply apply standard damage processing at the same time by setting up AttackArea2D and attack power as usual.
“Grazing”
Create a dedicated game object for handling grazing, and make it a child node.
- Grazing object setup
Set a HitArea that is larger than the parent object.
Using visual scripting, configure behaviors such as playing grazing animations or particles and increasing score when “Collide With Barrage Bullet” is triggered.
“Barrage Damage / Attribute Handling”
Since the standard damage system cannot be used, damage handling must be set up manually.
Store:
- Barrage damage in Variable A
- Barrage attribute in Variable B
- Applying simple damage
In the damage processing state, set up logic such as “Reduce HP by the value of Variable A.” - Applying attribute-based effects
Use transition link conditions like “If Variable B equals a specified value” to branch behavior accordingly.