We’d love to hear from you. Whether you have a question that you’d like us to answer as part of our FAQ,  you’ve identified something that just doesn’t quite look right in one of our tutorials, you have a business opportunity or for any other reason, please use this simple form to contact us.

We’ll do our best to provide a prompt response.

Like what you see?...pass it on!

Playing Background Music

Now let’s add some music to our title screen, which is exceptionally easy in Godot. To do this we simply add a AudioStreamPlayer Node to our game, parented to the root node. Your scene should now look something like this:

AudioStreamPlayer-node

Now we need to tell it what audio file to play. We have a song for our title scene in the folder assets\audio\music called InStormAndSunshine.ogg. Select this file in the File Systemt.

Selecting-the-music-file

With the AudoStreamPlayer selected, drag the ogg file to the Inspector and drop it on the Stream tab, like so:

Clipboard-Image_2

Also select Autoplay to On, which will cause the attached Stream to automatically be played when the AudioStreamPlayer is created. This means when our game loads, our music will start playing immediately.

Since we don’t know how long the player will be on the title scene, there is a good chance we want the song to play over and over again. This is done via import settings. Select the ogg file in the File System panel, then locate the Import tab. Make sure the Loop setting is enabled:

Clipboard-Image_3

If you change the value, be sure to click the Reimport button below.

Creating Your Title Screen<<PreviousTable of ContentsNext>>Global Data via Autorun

Like what you see?...pass it on!

script ends --->