Skip to main content

playSoundAtPosition

Play a sound and automatically dispose of it when it's done playing at a specific position.

Syntax​

engine.audio.playSound(soundName, position, options, withId);

Parameters​

NameTypeDescription
soundNamestringThe name of the sound to create.
positionVector3Array or Vector3The position of the sound.
options (optional)SoundOptionsThe options to use for the sound.
withId (optional)stringThe ID of the sound to create.

Returns​

Example​

const audio = engine.audio.playSoundAtLocation('fire', [0, 2, 0], {
volume: 0.5,
});

audio.play();

Available on: Client