Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+1)

There might be a good way to morph one sound into another. I just don't know it. But fading one sound in while fading another out works quite well.

var min_vol: float = 0.1
var max_vol: float = 0.6
# $Player.chest_to_world() returns a float from 0.0 to 1.0
func _process(_delta: float) -> void:
   $BreatheOut.volume_db = linear_to_db(min_vol+($Player.chest_to_world()*(max_vol-min_vol)))
   $BreatheIn.volume_db = linear_to_db(max_vol-($Player.chest_to_world()*(max_vol-min_vol)))