Skip to main content

createPlayerSound

Create a sound attached to a player.

Syntax

engine.audio.createPlayerSound(player, soundName, options, withId);

Parameters

NameTypeDescription
playerstring or PlayerManagerThe player id or player manager to attach the sound to.
soundNamestringThe name of the sound to create.
optionsSoundOptionsThe options to use for the sound. (optional)
withIdstringThe ID of the sound to create. (optional)

Returns

Example

const audio = engine.audio.createPlayerSound(player, 'fire', {
position: [0, 2, 0],
});

audio.play();

Available on: Client