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 it? 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:


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.


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


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:


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 it? Pass it on!
script ends --->