Voxel Game Maker

Docs Cookbook

Music that changes by zone

Place an object where the tune should play.

#Without code

  1. Place an object where the tune should play. Add Music zone and set its Range.
  2. Or drag music from the Music tab onto an object.

#Quick code

Where it goes: Event: Player enters the world; draw a zone named Forest with the Zone tool.

while true do
  wait_until(function() return in_zone("Forest") end)
  music_fade("Forest theme", 2)
  wait_until(function() return not in_zone("Forest") end)
  music_fade("", 2)
end