System information:
OS: Windows 10 Home v. 21H1
CPU: AMD Ryzen 7 2700X Eight-Core Processor 3.7 GHz
GPU: RTX 3060 Ti
Ram: 32.0 GB
In short, I’m trying to have a local firing sound for my guns, so I clone a sound instance that exists only on the client, parent it to a basepart, and playing it.
I run the code, and no sound is heard.
However
If I parent that newly cloned sound instance to workspace, it works fine.
(vr is not required to replicate this)
UPDATE: The cause has been found! the gun’s shoot sounds had its MinRollOffDistance set to 0, which seems to cause sounds not to work anymore in 3D space. but ONLY when they’re loaded in like that. attached repo still demonstrates this. setting the MinRollOffDistance to 10 and then testing shows it working just fine
Expected behavior
I expect the sound to be heard when I parent the newly created sound to a basepart. like it does in many of my other projects without issue.
so if RollOffMinDistance were 0, this whole equation unfortunately becomes 0.
To work around this, you could try using Enum.RollOffMode.Linear or Enum.RollOffMode.LinearSquare, which roll-off linearly or quadratically (respectively) from min distance toward max distance.
RollOffMinDistance used to be named EmitterSize, since it has an impact on the perceived size of the emitter – but this doesn’t necessarily make sense when using non-physical rolloffs like Linear or LinearSquare, so it was renamed to RollOffMinDistance.
InverseTapered has the same muting behavior with low minimum distances, because it takes the lesser of Inverse and LinearSquare.