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
- Under the barrel, add one empty GameObject per level, for example
Level1,Level2andLevel3. - Give each one a child Transform per muzzle. Point their blue (Z) axis where the shots should go.
- Add
SpawnGroupsanywhere on the weapon, set its Barrel and fill Groups in level order. - Call
SetLevelwhen the level changes. On an Upgradable Weapon, hook On Upgraded toSpawnGroups.SetLevel.
📐 Inspector Overview
| Field | Description |
|---|---|
| Barrel | Barrel that gets the spawn points |
| Groups | One parent object per level, starting at the first. Its children are the spawn points |
🎮 Actions
| Method | What 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.