Repro steps:
- Open a Baseplate
- Start a playtest
- Manually set your character’s
CFrame
very high up so that you fall for a while
Expected behavior:
Given that the sound action_falling.mp3
exists in the Roblox files, you should hear a “whooshing” of wind as you are falling.
Actual behavior:
A mistake in the RbxCharacterSounds
script prevents the FreeFall
sound from playing.
On line 159
, we see the function that gets called when the player’s Humanoid
changes to the FreeFall
state:
...
[Enum.HumanoidStateType.Freefall] = function()
sounds.FreeFalling.Volume = 0
stopPlayingLoopedSounds(sounds.FreeFalling)
playingLoopedSounds[sounds.FreeFalling] = true
end,
...
Oddly, the sound’s Volume
is set to 0
. However, this is intentional, as the Volume is meant to be proportional to the player’s Velocity, and is changed later by another function (line 210
):
-- updaters for looped sounds
local loopedSoundUpdaters: {[Sound]: (number, Sound, Vector3) -> ()} = {
[sounds.Climbing] = function(dt: number, sound: Sound, vel: Vector3)
local velocity = if FFlagUserSoundsUseRelativeVelocity then getRelativeVelocity(cm, vel) else vel
sound.Playing = velocity.Magnitude > 0.1
end,
[sounds.FreeFalling] = function(dt: number, sound: Sound, vel: Vector3): ()
if vel.Magnitude > 75 then
sound.Volume = math.clamp(sound.Volume + 0.9*dt, 0, 1)
else
sound.Volume = 0
end
end,
...
}
And, we can observe in-game that the Sound
itself, HumanoidRootPart.FreeFall
, will have a non-zero Volume
while our Velocity exceeds 75 studs/s.
The issue is, is that the state transition handler, the first snippet I showed, never plays the sound. Every other transition handler either sets .Playing
directly, or calls playSound
, which plays it from the beginning by setting the TimePosition
to 0
and setting .Playing
to true
. Therefore, either of these will work as a resolution, the fix is a one-liner:
...
[Enum.HumanoidStateType.Freefall] = function()
sounds.FreeFalling.Volume = 0 -- This line could technically be removed
sounds.FreeFalling.Playing = true -- THE FIX
stopPlayingLoopedSounds(sounds.FreeFalling)
playingLoopedSounds[sounds.FreeFalling] = true
end,
...
Workaround: Fork the RbxCharacterSounds
script to fix it yourself. It is located at Players.<Player Name>.PlayerScripts.RbxCharacterSounds
. Here is a demo of the fixed version:
Frequency: Always
If you’ve been reading extra carefully, recall what the LocalScript
’s playSound
function does, from 672
characters ago:
plays it from the beginning by setting the
TimePosition
to0
and setting.Playing
totrue
Putting this extra attention to use, you will realize this code is so old, it appears to predate the Sound:Play
function, which does exactly what playSound
is doing, or at least deliberately chooses not to use it, for whatever reason.