Sound
plays a cooked sound at a point in the world on every client, and sets the volume of surface contact sounds
Properties
1 member Access: server write
- SurfaceSoundsVolume:
number volume of surface contact sounds, 0 to 1
Methods
1 member Access: shared
- PlayAt
(assetId: string, position: vector, volume: number?) -> boolean play a cooked sound at a world position on every client
Parameters
Name Type Description assetId string Decimal asset identifier for the audio stream. position vector World point in studs. volume number? Linear gain, 1 being the authored level. returns boolean —
Playing Positional 3D Audio
Lifecycle: Shared
A sound plays at a world position, so distance and direction follow from the listener camera.
Luau
-- Decimal asset identifier for the cooked audio streamlocal soundId = "72057594037928450"local contactPoint = Vector3.new(0, 5, -12)local played = game.Sound.PlayAt(soundId, contactPoint, 0.8)if played then print("Spawned 3D audio emitter at", tostring(contactPoint))end Output: Spawned 3D audio emitter at 0, 5, -12