Skip to content

Exercise 16: A blast you can hear

Purpose. To give the explosion a sound that is fired with it and comes from its place in the world. The sound should never play exactly the same way twice.

A sound belongs to an effect as much as its sparks do. It must start at the same instant, come from the same spot, and vary from one blast to the next. A Sound can be transformed like anything else, and then it is fired, timed and layered with the rest.

  • The Explosion folder from Exercise 15 is in the workspace.
  • One new ordinary Part named Boom is inside the folder, at the centre of the explosion, anchored, with Transparency 1 and CanCollide off.
  • Inside Boom is one Sound named Blast, with its SoundId set to an explosion sound.

Steps 1, 2 and 6 repeat earlier exercises on a new kind of emitter.

StepControlActionResult
1BlastSelect, then press TransformThe Properties panel shows the sections of a Sound emitter, with Emission and Sound open. The Emit box reads 1.
2HUD ▸ Emit buttonPressThe sound plays once, from the place where Boom is.
3Properties ▸ Sound ▸ SpeedEnter 0.9, 1.15No change yet.
4HUD ▸ Emit buttonPress several timesEach play has a slightly different pitch.
5Properties ▸ Sound ▸ Roll-off MaxEnter 150The sound is no longer heard from more than 150 studs away.
6ExplosionSelect, then press Emit on the HUDFire, smoke, flash, jolt, shockwave and sound go off together.

A Sound emitter plays a duplicate of the Sound each time it is fired. Transform keeps the Sound’s volume, speed, roll-off distances and Looped setting. It starts with an Emit count of 1.

The sound comes from the Part or Attachment that holds the original Sound, and follows it if it moves. A Sound emitter nested in another emitter plays from each parent particle and travels with it.

RowStarts atWhat it sets
Emission ▸ Lifetime0How long each play lasts, in seconds. At 0 the sound plays once to its end. Above 0 the play is cut off at that time.
Emission ▸ Start At0How many seconds into the clip the play begins.
Emission ▸ LoopedThe Sound’s own settingThe clip repeats until the Lifetime ends.
Emission ▸ 2D (local)OffOn, the sound has no place in the world. It is heard at the same volume everywhere.
Sound ▸ VolumeThe Sound’s own volumeThe volume, over the life of the play.
Sound ▸ SpeedThe Sound’s own speedThe playback speed, which is also the pitch, over the life of the play.
Sound ▸ Roll-off MinThe Sound’s own distanceThe distance, in studs, at which the volume begins to fall.
Sound ▸ Roll-off MaxThe Sound’s own distanceThe distance, in studs, beyond which the sound is not heard.

Volume and Speed are graph rows. Two numbers typed into either one give each play a value of its own between them, as with Speed in Exercise 1. A drawn graph changes the value while the sound plays.

SymptomCauseAction
No sound at step 2The Sound has no SoundId, or Studio’s own volume is off.Set the SoundId on the RenderTemplate inside Blast, which is the duplicate that is played.
The sound is equally loud everywhere2D (local) is on, or the Sound is not inside a Part or an Attachment.Switch 2D (local) off. Keep the Sound inside Boom.
The sound is cut shortLifetime is above 0 and shorter than the clip.Enter 0 for Lifetime.
Many sounds pile upEnabled is on.Switch it off and use the Emit box.
The sound does not fire with the restBoom is not inside Explosion.Drag it into the folder.
ChangeResult
Sound ▸ Volume 0.4, 0.6Each blast is a little louder or quieter than the last.
Sound ▸ Volume, a graph that falls to 0The sound fades out as it plays.
HUD ▸ Delay 0.1 on BlastThe sound arrives a moment after the flash, as from a distant blast.
A Sound emitter inside the RenderTemplate of the rocket of Exercise 9Each rocket carries its own whoosh, which stops when the rocket ends.
Looped on, Lifetime 3, a Speed graph from 0.6 to 1.4A hum that rises in pitch for three seconds.
Emission ▸ 2D (local) onA sound for a menu or a screen effect, heard at full volume wherever the camera is.
New in this exerciseTransforming a Sound. Speed as pitch. Roll-off Max. Lifetime 0.
Done beforeTransform (eight times). The Emit button (nine times). Two numbers in a graph row (Exercise 1). A Folder fired as one (Exercises 10, 11 and 15).
Carried forwardKeep Explosion. The next two exercises fire it from a script.