Effects

Three small helpers for sounds and effects. Hook them to the events of Health, Hitbox or Health Pickup.

ComponentWhat it does
Sound GeneratorPlays a random sound at a random pitch
Spawnable EffectSpawns an effect prefab
SelfDestructRemoves an object after a few seconds

For example, the ducks in the examples die like this: On Death calls a Spawnable Effect, which spawns a splash. The splash’s Sound Generator plays a squeak, and its SelfDestruct removes it after 2 seconds.

🔊 Sound Generator

Add Component: Glowing Rifts > Misc > Sound Generator

FieldWhat it does
Audio SourceThe source to play through. Uses the one on this object if empty
SoundsClips to pick from at random
Pitch RangeLowest and highest random pitch
Play On EnablePlays as soon as the object appears. Turn it on for effect prefabs

Call Play() from an event, such as a hitbox’s On Hit.

✨ Spawnable Effect

Add Component: Glowing Rifts > Misc > Spawnable Effect

FieldWhat it does
EffectThe prefab to spawn

Call Spawn() to spawn it at this object, or Spawn(DamageData) to spawn it where a hit landed.

⏳ Self Destruct

Add Component: Glowing Rifts > Misc > SelfDestruct

FieldWhat it does
LifetimeSeconds before the object is removed

Put it on effect prefabs so they clean themselves up.

Tip

Step by step: Add Sounds and Effects.