Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Hey! Sure! I always like to look at other people's code. If you want to take a look at any of mine, the source is linked in the submission for the jam ;)

About the name, if it makes you feel better, I didn't know if "needle" was a common word for the thingies, or just word-play for the title, and I had to look up the proper name for them xD.

You just need a slider going from -24 to 0 value wise (you can use a different range, I like that one which was used in the tutorial I followed). Then you connect the value_changed signal to a script running this code:

func _on_VolumeSlider_value_changed(value):
    if value == -24:
        AudioServer.set_bus_mute(AudioServer.get_bus_index("Master"), true)
    else:
        AudioServer.set_bus_mute(AudioServer.get_bus_index("Master"), false)
        AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), value)

You need to tweak the buses if you want to use different ones for music and sound effects. This will affect the master volume. Enjoy!