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
Name | Type | Description |
---|---|---|
soundName | string | The name of the sound to create. |
position | Vector3Array or Vector3 | The position of the sound. |
options (optional) | SoundOptions | The options to use for the sound. |
withId (optional) | string | The ID of the sound to create. |
Returns
SoundManager
- The sound manager.
Example
const audio = engine.audio.playSoundAtLocation('fire', [0, 2, 0], {
volume: 0.5,
});
audio.play();
Available on: Client