Skip to content

MusicNode

class MusicNode extends Node2D

Description

A Node2D used for setting the music track in a Room.

Note: This doesn't need to be set in every room. The music track set by a MusicNode will stay until it is overridden by another MusicNode.

Methods

static func change_music(music: AudioStream, gain: float, pitch: float) -> void

Changes the global music playing to the given loaded music resource with the given gain and [param pitch] Note: gain is in linear energy.

gdscript
MusicNode.change_music(load("res://music/mus_intro_test.ogg"), 0.75, 1.17)