createPlayerSound
Create a sound attached to a player.
Syntax
engine.audio.createPlayerSound(player, soundName, options, withId);
Parameters
Name | Type | Description |
---|---|---|
player | string or PlayerManager | The player id or player manager to attach the sound to. |
soundName | string | The name of the sound to create. |
options | SoundOptions | The options to use for the sound. (optional) |
withId | string | The ID of the sound to create. (optional) |
Returns
SoundManager
- The sound manager.
Example
const audio = engine.audio.createPlayerSound(player, 'fire', {
position: [0, 2, 0],
});
audio.play();
Available on: Client