vol.gd 373 B

12345678910111213
  1. extends HBoxContainer
  2. @export var bus: int = 0
  3. # Called when the node enters the scene tree for the first time.
  4. func _ready():
  5. find_child("Button").connect("value_changed", pls)
  6. func pls(val: float):
  7. if val < 50:
  8. AudioServer.set_bus_volume_db(bus, -5 - pow(50 - val, 0.9))
  9. if val >= 50:
  10. AudioServer.set_bus_volume_db(bus, 5 -(100 - val) / 5)