Upgrading From Older Versions
This version reorganizes how weapons are wired. Older versions migrated old prefabs automatically; that migration has been removed, so prefabs saved with a version before the weapon refactor need to be set up again.
Warning
Back up your project before upgrading. Old prefabs lose their barrel stats, their UnityEvent hooks and their barrel-to-magazine links.
📁 New Folders And Namespace
The package now uses the same layout as the Modular Health System:
| Before | Now |
|---|---|
Core (models, materials, sounds, prefabs) | Weapons: the ready-made weapons, with their models, materials, sounds and prefabs |
Core/Inputs | Runtime/Input |
Runtime/Weapon | Runtime/Weapons |
Health, Hitbox, DamageData | The Modular Health System, now required (same GUIDs) |
Example | Examples, opened from the ModularWeaponSystem_Examples hub scene |
Example/BlueprintExample/Blueprint Example.unity | Examples/BlueprintExample/BlueprintDemo.unity |
Example/DuckShooter/Scenes/DuckShooter.unity | Examples/DuckShooter/DuckShooter.unity |
RocketLancher prefab | RocketLauncher |
Note
Asset GUIDs are unchanged, so your scenes keep their references. Delete the old package folder before importing so no stale copies are left behind.
✅ What To Redo On Each Weapon Prefab
Assign the magazine on the Weapon
The magazine moved from the barrel to the Weapon (and to Secondary Magazine on a DualWeapon). Leave it empty for infinite ammo.
Re-enter the barrel stats
Bullets Fired, Fire Rate and Damage now live under the barrel’s Config. Damage per bullet replaces the old per-barrel Damage Points.
Add a Firing Mode
The Shooting Mode moved off the barrel’s stats to a Firing Mode component. Add one to every semi automatic or burst barrel. A barrel without one fires full automatic. The burst size is now its Burst Count (3 before).
Rewire the events
Events are now grouped. Re-add your listeners under:
eventson every barrel (On Start Shooting, On Shot, On End Shooting)hitEventson raycast and shotgun barrels (On Hit)projectileEventson projectile barrels (On Projectile Spawned)laserEventson laser barrels (On Impact)eventson magazines (On Depleted, On Start Reload, On Reload Complete)
Check the recoil
The Weapon no longer references the recoil. The Recoil listens to the barrels under it by itself, or to the one in its Barrel field.
Set Pellets Per Bullet on shotguns
The shotgun’s list of pellet particle systems is replaced by Pellets Per Bullet and a single Pellet Trace particle system.
Move laser wind-ups to a Spool
The laser barrel’s Wind Up Time and On Wind Up are gone. Add a Spool to the barrel’s GameObject and set its Wind Up Time instead. Hook your old wind-up listeners to the spool’s On Wind Up Start.
🧑💻 Code Changes
| Before | Now |
|---|---|
barrel.magazine | weapon.magazine |
barrel._OnShot and other barrel events | barrel.events.OnShot |
_OnHit | hitEvents.OnHit |
OnProjectileSpawned | projectileEvents.OnProjectileSpawned |
OnImpact on lasers | laserEvents.OnImpact |
OnWindUp, windUpTime on lasers | A Spool on the barrel: events.OnWindUpStart, Wind Up Time |
Overriding Barrel.Prepare(Action) | A BarrelModifier implementing BeforeShooting(proceed, cancel) |
magazine.OnDepleted and other magazine events | magazine.events.OnDepleted |
Recoil.Follow | Removed: assign the recoil’s Barrel field, or leave it empty |
Get* barrel getters | FireRate, BulletsFired and config |
shootingMode in BarrelStats and BarrelConfig | FiringMode.mode on the barrel |
| Changing barrel stats directly | barrel.ApplyConfig(barrelConfig) |
using GlowingRifts.ModularWeapons; | using GlowingRifts.ModularWeaponSystem; (.Example for the example scripts) |
WeaponEvents.OnEquiped | WeaponEvents.OnEquipped |
CubicSpline.GetGradientSamples, GradientSample and Length | Removed (unused) |
| Create > Glowing Rifts > Modular Weapons > Barrel Config | Create > Glowing Rifts > Modular Weapon System > Barrel Config |
Health, Hitbox, DamageData, Hitpoint in GlowingRifts.ModularWeapons | Now in the Modular Health System, namespace GlowingRifts.ModularHealthSystem |
Hitpoint hooked to a hitbox’s On Hit | Hook On Hit to Hitpoint.ShowDamage; ShowText shows any text |
Health.Kill() always destroying the object | Destroy On Death toggle, plus OnDeath, Heal(DamageData), AffectHealth, ResetHealth |
✨ New In This Version
- Barrel Config assets and
barrel.ApplyConfig - Upgradable Weapon with a list of level configs
barrel.SetSpawnPointsto change muzzles at runtime- Firing Mode for semi automatic, burst and full automatic
- Spool wind-up and wind-down, and custom barrel modifiers
- Health modifiers, including
Invincibility - Infinite ammo when a weapon has no magazine
- The Duck Shooter example