createSound
Create a sound.
Syntax
engine.audio.createSound(soundName, options, withId);
Parameters
Name | Type | Description |
---|---|---|
soundName | string | The name of the sound to create. |
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 sound = engine.audio.createSound('fire', {
position: [0, 2, 0],
});
sound.play();
Available on: Client