Create an audioSource component for entity-attached audio.
Asset key for the sound
Channel to play on
Optional
Optional configuration
Component object suitable for spreading into spawn()
ecs.spawn({ ...createAudioSource('explosion', 'sfx'), ...createTransform(100, 200),}); Copy
ecs.spawn({ ...createAudioSource('explosion', 'sfx'), ...createTransform(100, 200),});
Create an audioSource component for entity-attached audio.