AmbienceLoop.component
README.md
AmbienceLoop
A quiet looping background bed for a place, such as the hum of a building or the air of a hall. It is heard by each player on their own machine, at the same level wherever they stand, with no 3D falloff.
Add it to any entity in a scene. With no clip it plays soundstage's station bed, media/audio/ss_bed_station.soundClip, which was installed on its own from the Soundstage kit (ZeroMind asset e6aff3f7-f4b5-4242-bb00-5ea5d3b517f8, MIT). That bed is a low electrical hum with air recyclers, a soft machinery drone and distant beeps. In Crumple Zone it stands in for the crash hall's plant room.
-- in a scene's build.luau content(), or from game code
local amb = entity.spawn("HallAmbience")
amb.component.add(asset.resolve("AmbienceLoop", "component"), { volume = 0.35 })
| Field | Default | What it does |
|---|---|---|
clip | empty (station bed) | The looping soundClip to play. |
volume | 0.35 | Level once faded in, 0..1. Keep it low: it sits under the impact sounds. |
fadeIn | 3 | Seconds it takes to fade in when play starts. |
on | true | Turn it off without removing the component. |
It needs nothing else on the entity. It adds a looping, non-spatial Audio component with sourceType = "Ambient", only in play mode, and removes it when the component or the entity goes away. Nothing syncs: every peer plays its own copy, which is right for a bed every player hears the same.