Master the Mix: Make Your Island Sound Professional
verse-library
# This is the Audio Mixer device.
# Drag your Audio Mixer device into this slot in the editor.
@editable
AudioMixer : audio_mixer_device = audio_mixer_device{}
# note: audio_mixer_device manages sound buses via control bus mixes.
# Use ActivateMix/DeactivateMix to switch between mix presets configured
# in the editor. Volume changes must be wired via the Audio Mixer device's
# mix settings in the editor (e.g., set the mix to reduce music bus volume).
# This runs once when the game starts.
OnBegin<override>()<suspends> : void =
# Connect the trigger to our function.
# When someone enters, run 'OnPlayerEnter'.
TriggerVolume.TriggeredEvent.Subscribe(OnPlayerEnter)
# This function runs when a player enters the trigger.
# trigger_device events pass an optional agent, so we accept ?agent.
OnPlayerEnter(Agent : ?agent) : void =
# Activate the mix configured on the Audio Mixer device.
# Set up your mix in the editor to lower the Music bus volume to ~20%.
AudioMixer.ActivateMix()
# note: To control a separate Effects bus, add a second
# @editable audio_mixer_device for your effects mix and
# call ActivateMix on that reference instead.