Skip to reading
GDScript Programming & Godot

FadeMusic()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Music: Fade

Fade the current music to a normalized volume, waiting for the fade routine.

Source table from FadeMusic(), page 202
Option key / fieldMeaning and inputDefault
Target Volume volumeNormalized target volume: 0 is silent, 1 is full volume. Range: 0.0 to 1.0.0.0
Duration (seconds) durationTime in seconds for this action. Read its timing note before assuming it waits. Range: 0.0 to 60.0.1.0

Timing. Waits for the fade routine.

Code example
await FadeMusic({"volume": 0.0, "duration": 1})

In use. Fade to 0 over 2 seconds for a room ending, or to a quieter nonzero level under narration. A zero target stops playback; volume is 0 to 1.

SeekMusic()#

Skip Ahead in Soundtrack

Move playing music to minutes plus seconds.

Source table from FadeMusic(), page 202
Option key / fieldMeaning and inputDefault
Minute minutesWhole minutes; added to Seconds to form a playback position.0
Second secondsNumber; decimals allowed.0

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await SeekMusic({"minutes": 0, "seconds": 1})

In use. Seek to 1 minute 10 seconds to check a cue. This is media playback positioning, not a timeline scheduler or a music crossfade.

Page 202 of 378Permalink
Go to page