How to keep music between scenes? Godot 3 Autoload / Global nodes tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Adam Smith asked me how to get the music to play through all the scenes a problem we need to use global nodes which is also called outlaws in the Godot engine but voltages are after loads great question it's when you automatically load something let's use an example first we need to create a music controller that we'll be playing our music this will be a Godot scene and it must be independent of the current scene both of them need to have our connection with the main loop which is the tree that's why you need to use get tree change scene to blah blah to change the scene we can have for example level 1 or level 100 but we can't have 2 main scenes that's why we will use auto loss functionality which will automatically load our music controller auto loads once change when we will switching the scenes using this method the scenes won't stop or wrested the music data between this switch here is a short description from the documentation what this object can do making a long story short they are pretty useful I also use them in my game dungeon rescuer I encourage you to play it it's time to practice here we have two scenes with the player from my last tutorial how to switch scenes using door or portal so if you want to know how to do it give a try let's add the music controller scene in the new folder out load the root note of this scene will be a basic note and inside let's add audio stream player which is a note for playing the music [Music] I prepared here two music files from my game hammer kick let's load Bethlem using and fried a function to plate when you load the music file it will be a stream for out the Austrian player by default so it's very easy to use next let's also change the name for the root note and add our full scene to outer loads [Music] in this way you can see on their remote panel which is your life representation of the main tree that the music controller is loaded the final step is to add a script star level to start the music you [Music] as you can see we don't have a pause between scenes and the music is playing independently bonus we can add more function in the music controller for better understanding for example let's change the music on the right side of the door and turn down the volume on the left side of the door we need new functions in the music controller script for playing and turning down the volume [Music] triggers which will be Aria to the wave collision shapes [Music] signals that the screen scripts which will use their music controller functions [Music] you [Music] and that's all for this tutorial I also want thanks for pixel frog for sharing this great assets there for free and of course to thank you for watching and support like if you liked it dislike if you didn't and have a great day night and so on
Info
Channel: Rafa Fiedo
Views: 20,079
Rating: undefined out of 5
Keywords: godot music controller, godot autoload, godot autoload singleton, music controller, godot, sheetcode, godot music between scenes, godot game, godot tutorial 2d, godot tutorial series, godot switch scenes, godot scene change music, godot scene music, gotod autoload, godot autoload script, godot autoload scene, why are you reading my tags?, godot help, godot gamedev, gamedev, godot tutorial, godot engine, godot games, godot 2d tutorial, godot pixel game, godot 3
Id: xT51BO8KrIg
Channel Id: undefined
Length: 5min 28sec (328 seconds)
Published: Thu Jun 25 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.