Skip to content

Play Sound

A sound from a point on the map or straight into the player's ears — with every knob the engine has

playsound true @sfx-explosion 1 1 0 10 10 true
Field What is in it
first whether the sound is positional
second which sound: an @sfx-… constant
third volume
fourth pitch
fifth pan: further left or right
sixth and seventh the point, if the sound is positional
eighth whether to limit overlapping

A positional sound is tied to a point on the map: the further the player’s camera is from it the quieter it gets, and it is heard from the side the point is on. That is how shots and explosions sound.

A global one sounds the same for everybody everywhere — it is how you say an event happened, not that something knocked somewhere. Volume and pan work on it; coordinates are not needed.

Every sound in the game is available as the constant @sfx-<name>: @sfx-explosion, @sfx-shoot, @sfx-pew, @sfx-place. The list is the same as the game’s files, and the editor’s picker shows all of it.

Unofficial fan project, not affiliated with Anuke. Mindustry sprites, fonts and translations © Anuke, used under GPL-3.0; Fira Code under OFL-1.1. Site code is GPL-3.0.