Wind sound when falling

So I want to make a system when you fall it starts playing a wind sound that starts silent then goes louder and louder until a limit of course. This is an example:

I have made an audio for it: https://www.roblox.com/library/6960193959/falling-wind

But I don’t know how to make the script. I cant wrap my head around it since I’m still not a advanced scripter I don’t know much about a few things needed.

1 Like

Is your sound seamless when looped? It will need to be.

Are you falling at normal Roblox gravity speeds? If so, you’ll need to fall pretty far or you won’t have time to get the effect.

I would suggest detecting the players state, trigger the sound on the falling state. Then I’d just use variable or maybe a tween to scale the volume and maybe even the pitch(speed) of the sound playback over time until the splat. (detect when the falling state is over and stop your wind sound)

This will probably need to be a localscript that monitors the humanoid state continuously. You can read about the states here:

2 Likes

We don’t really give scripts, but based on the video I’d say it involves the velocity of the character, the state of the character (Falling state), and the volume of the sound dependent on the velocity.

2 Likes

using the y velocity, you can set the volume and speed so it will get increasingly loud(wind sound).

How Can I detect the Y velocity?

I wasn’t asking for the script I wanted to know how I can make it. But thanks

You can try it, but I wouldn’t use velocity as that number will get very big very fast (with default roblox physics and gravity) and you’re pitch could end up being a high pitched squeal. I would just use free fall time and have a max so the pitch and volume will level at some point.

Mhm. Thanks and also how much time falling does it take for the Free falling value to activate?

I think its pretty quick. Like almost instant, it may activate every time you jump.

On the velocity thing, if you try to use it, you will reach a high value very quickly, so you may not get your ramp up sound effect.

1 Like

You should start by making a simple localscript that just prints out your character’s humanoidstate and just observe in the output when you do various jumps and falls.

1 Like

Quick question. What line of code would I use to detect the player state?

Here is a simple localscript you can use to observe how it works:

humanoid = game.Players.LocalPlayer.Character.Humanoid

humanoid.StateChanged:Connect(function(oldstate, newstate)
	print("oldstate:", oldstate, "newstate", newstate)
end)

make this as a new ‘localscript’ in the startergui or startercharacter folders
then run your game and look at the console output

you will see the state changes constantly as you walk run jump etc. As I suspected the freefall state is triggered even with a jump.

1 Like

I get the error saying Humanoid is not a valid member of workspace.myCharacter

where did you put the localscript, can you post a screenshot of the game explorer

its a LocalScript In starter gui

Never mind. I placed it startercharacter and it worked.

Okay, good, it should probably really have a wait in there for the character, I just wanted to show you something quickly.

for example: LocalPlayer.CharacterAdded:Wait()

1 Like