Sounds in specific areas

Hey y’all, is it possible to add sound in such a way so that when your camera hovers over sand it sounds like blowing sand, but when over water if sounds like moving water? And when your camera goes underneath the water it sounds like your’e underneath water? So that the sound changes instantly.

You could most likely use Region3s or raycasting to get the effect you want. Raycasting returns a material which you could use to detect if a player’s camera position is over water or over sand.


“Underwater” sound effect

Someone has created an uncopylocked place containing a script you could use for this. You can find it here:

“Blowing sand” and “moving water” sound effects

To accomplish this you could use, as @zQ86 mentioned, raycasting. Simply create a ray facing straight down from the camera’s position and check the material (the fourth value in the tuple returned by Workspace:FindPartOnRay) to see if it is sand or water.