In certain games, setting SoundService.CharacterSoundsUseNewApi to enabled doesn’t always work. It depends on the game, in some it works fine, in others it consistently doesn’t work, both in Studio and the player. The problem seems to be that the AudioEmitter isn’t correctly parented to the HumanoidRootPart of the characters. Specifically, line 182 in StarterPlayerScripts.RbxCharacterSounds, which is:
humanoidRootPart = humanoid.RootPart
It seems that it’s not always initialized when the script runs, leading the variable to be set to nil. A fix could be instead using the rootPart variable defined earlier, which is used to parent the AudioPlayers, which are parented correctly.
Here’s a game in which the character sounds don’t work, resetting your character does not play the death sound: Work Showcase | Play on Roblox
2 Likes
@Real_OrigamiM thanks for the detailed report and the suggested fix! We’ll look into fixing this.
On it! I just put up a patch and added some tests to cover it. Thanks again for the report!
Okay, I have some changes made locally to the RbxCharacterSounds script, but running that experience in my client doesn’t fix it. Is there anyway you can send me a copy of the .rbxl file or allow me to open it up in studio to take a look and validate/debug?
Sure, the problem seems to be with old games. It doesn’t work in any of the ones I’ve tested, and in one I removed everything but the base plate to verify it wasn’t something I added that breaks it, which I attached here. I also attached a baseplate I created just now which works fine. If you want the original one I linked above, I can send that as well.
NoSound.rbxl (52.3 KB)
HasSound.rbxl (57.6 KB)
1 Like
Iiiiiiinteresting. It seems that the script is not running because it is using an older version that doesn’t have an AtomicBinding child to the RbxCharSounds script.
Okay, I have a fix… mostly. The change I will put in will get the emitters to be created, but you still won’t be able to hear anything until:
- we roll it out, and
- you set a DefaultListenerLocation to be “Camera” or “Player”.
Set to “Default”, this won’t automatically spawn a listener in older experiences.
Using the new API means you have to be intentional about having a listener.