New Method: Sound or AudioPlayer :PlayAtPosition

As a Roblox developer, especially with the new audio API, it is currently unnecessarily difficult and slow to play a sound at a specific position. As of today, there’s a requirement that to play a sound in 3D space at a specific position it requires the Sound or the AudioEmitter is parented inside of a BasePart or Attachment. This often requires developers to move parts or attachments around to play sounds in specific locations, or reparent Sounds or AudioEmitters to do this.

In my game Aftermath, I was finding that I needed so many sounds for basically the same purpose that I resorted to creating a system which created groups of sound objects that are often played together inside of parts so that I could move those part where I needed them to play a sound just to avoid extra unnecessary cloning of sounds or reparenting sounds all the time. After doing this, I was able to remove tens of thousands of sound objects that really only needed to be played at a specific position at any given time. Even with this process, the performance overhead of moving parts around or reparenting sounds feels very unnecessary if an API like this could exist.

Sound:PlayAtPosition(position: Vector3)
AudioPlayer:PlayAtPosition(position: Vector3)

7 Likes

Would be nice to have, I ran into this issue before as well

One trick you can use is Put the Sound under an Attachment parented to workspace.Terrain

Because Attachment has a position you can get 3D sound without using parts

might be better for your setup

Again a nice to have feature, I support the feature request

3 Likes

Very nice suggestion. Maybe Workspace:PlaySoundsAt(sounds: Sound | {Sound}, at: Vector3) could be more insteresting, though.

Let me also use this opportunity to resuggest a similar API for ParticleEmitters (Workspace:EmitParticlesAt(particles: ParticleEmitter | {ParticleEmitter}, amount: number | (ParticleEmitter) -> number, at: CFrame)) cof cof.

(post deleted by author)