Running sounds keep playing when changing humanoid state to Physics

Low priority but also easy to fix

Repro:

  • Call while standing on the ground:
    game.Players.LocalPlayer.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
  • Make your character move, e.g.:
    local f = Instance.new("VectorForce",workspace); f.Attachment0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootRigAttachment
  • Press movement controls

You will hear the footstep sound even if the character can’t walk, which is probably undesired.
It will also occur if you change state to PlatformStand.

This bugs happens because the RbxCharacterSounds script doesn’t handle the humanoid state switching to Enum.HumanoidStateType.Physics. The previously playing looped sound stays enabled, which is Running in this case and the sound is still updated according to Velocity and MoveDirection.

It can be easily fixed by adding an else case in the StateChanged handler in RbxCharacterSounds.

Use case: Putting a character into a vehicle without using the Seated state so you can’t jump.

3 Likes