Spawn Groups

SpawnGroups gives a barrel a different set of spawn points (muzzles) per level, so an upgraded weapon can fire from two or three muzzles instead of one.

Add Component: Glowing Rifts > Modular Weapon > Spawn Groups

🧱 Setup

  1. Under the barrel, add one empty GameObject per level, for example Level1, Level2 and Level3.
  2. Give each one a child Transform per muzzle. Point their blue (Z) axis where the shots should go.
  3. Add SpawnGroups anywhere on the weapon, set its Barrel and fill Groups in level order.
  4. Call SetLevel when the level changes. On an Upgradable Weapon, hook On Upgraded to SpawnGroups.SetLevel.

📐 Inspector Overview

FieldDescription
BarrelBarrel that gets the spawn points
GroupsOne parent object per level, starting at the first. Its children are the spawn points

🎮 Actions

MethodWhat it does
SetLevel(int level)Turns on the group of that level (0 is the first), turns the others off and gives its children to the barrel with barrel.SetSpawnPoints. Levels past the last group use the last one

Tip

Every shot fires from every spawn point, and each spawn point fires the barrel’s Bullets Fired. Lower the damage in the level’s Barrel Config if more muzzles make the weapon too strong.

The Duck Shooter ship uses it for the Phaser: one muzzle at level 1, up to four at level 4.