Thanks for watching! Ya'll are the best! Don't drink and drive! Write home often! Just say no! Look both ways before crossing the street! Don't take candy from strangers.... unless they have a crunch bar... yeah, crunch bars are good, take those if the opportunity arises.
I had a nightmare of a time figuring out why my audio was looping, thankfully you explained if you put it in _process(delta) it plays 60 times a second which makes so much sense, thankyou so much!
Pirate Software sometimes talks about tutorial he11, how you can keep watching tutorial after tutorial, without ever advancing to DOING stuff yourself. Well, this tutorial just told me almost everything I need and I am now unstuck and very grateful to you. THANK YOU!
Busy with my 2nd game and thought I should get to sound and music at some point, but remembering how awful it was implemented in my first game really put me off. Thanks, it was actually pretty useful.
You should make a video about music, but more in depth. A video talking about a concept for a system that plays music. However one that works for multiple songs. A music state machine if you will. That handles repeating the music and playing a new song. I had a simple system for it where you store the song name as a String. Then I auto loaded the script. I had a function called stop_music() which cleared the current track. The a play_song(name) function. The play_song called stop_music then I had a bunch of elif logic like if name == "song_one": $SongOne.play(). However this takes a long time to set up and it would be cool if you could find a better system for it. Just an idea. Nice video btw
I will be adding music to my game eventually, and it will be in a slightly more complex way then just music in the background... if everything goes to plan... so maybe after I do that I will have a bit more experience on the subject and be able to make a video on it. Great Idea! :)
I literally cant get sound to play outside of the inspector tab, except when autoplay is checked Things like this are super disheartening. Random things just stop working, or never work to begin with, and it makes me want to not do this any more. I have such great ideas for my game, and it's frustrating that they wont become real because of the non stop random hang ups.
Do you have any solution for "listening" for audio from the player's position, rather than from the camera's position? There's a Listener node that works for 3D, but not for 2D....
hm... I haven't heard of that before, (sorry it took me this long to respond,) Seems like there aught to be something like that though because so many games, such as mobas, use stuff like that. If I find anything I'll let you know. :)
Is there a way to let the same music keep playing when changing scenes? I have a main menu and a options menu and both are different scenes. I want the menu music to keep playing with no break when switching between them, but I also want completely different music ingame.
Yes, make a singleton, in godot they are called AutoLoads, (there are plenty of tutorials on how to make an autoload) and put your audio stream player there. Autoloads are scenes or scripts that are always running no matter what the active scene is. Very handy for things like inventories or save systems, as well as playing music between scenes. :)
I guess drag and drop them there? Or just change the transform. If I need the sound to come from a particular location in the game I might put a regular node in that location and then attach the audio node. But audioStreamPlayer2D nodes can already be placed wherever so you should be good. :)
Try looking at the import, on some audio files the import can be set to auto repeat. select the audio file, then open the import tab, uncheck the box that says repeat, and then click reimport, hopefully that works for ya.
Can you make a tutorial on cloning other populer games in godot. Fan made Sprite sheets are available online for free. You can start with Mario then hollow knight then plant vs zombie then ... I think you get the point. You can turn it into a series if you want. You don't have to make a complete one to one copy just one or two game mechanics that are unique to that game. Like Mario has variable jump hight and acceleration or in hollow kinght the pogo mechanic (when hit downward on a spike it pushes the character upward) you have covered many of them in the past too like wall slide and double jump (my Favorite)
That would be cool. I like the idea, I'll write it down, eventually I plan to have some sort of connected series more then just random tutorials, but I guess we will see what that ends up being. Thanks! :D
i need some small help i've got my bg music in another scene which is always loaded and i wanna try to pitch it down when my player is hit for the death screen as a sadder tone but i am struggling trying to find anything on how to shift the pitch using the code
@@Artindi how would i use it from my player hit detection script to link to the audio in another scene sorry i'm still very brand new to this and figuring out how things work
@@SydneyPawYT If you are using a Autoload then you can call the functions in that script from any script. That's what I do, just make an auto load script with your music and whatever functions you might need to play/stop or adjust the song, then you can call those functions from anywhere.
Not sure man, if the sound files are normal then it must be how you are exporting it or how your operating system works. have you sent your project to a computer with windows to see if the sound works there? because I don't know if there is a export option for ubuntu 20.
Are you fr? You just drag the file into godot…. Or drag it into the folder your godot project is in… you really need a video to tell you how to do that?
@@Artindi i mean the sound just keep playing after i add it it doesn't stop keep repeating i just wanna make the player get hit by vase like crash once but i cant 🤣
@@Mohamed88Hassan Maybe you have the if statement shown in the video when you don't need it? Not sure, I would need to see your code to really help. :/
probably not in the way that ears work, but you can detect if specific sounds are playing, and then you can check to see how far away they are. I think it may be a system that you would have to build yourself. There might be a way to do it, but sadly I have no idea what that might be. sorry. :/
Thanks for watching! Ya'll are the best! Don't drink and drive! Write home often! Just say no! Look both ways before crossing the street! Don't take candy from strangers.... unless they have a crunch bar... yeah, crunch bars are good, take those if the opportunity arises.
Great, thanks. Now the first step out of silence has been done within my game :D
That's one small step for dev.... one... giant leap... for dev-kind.
I had a nightmare of a time figuring out why my audio was looping, thankfully you explained if you put it in _process(delta) it plays 60 times a second which makes so much sense, thankyou so much!
Pirate Software sometimes talks about tutorial he11, how you can keep watching tutorial after tutorial, without ever advancing to DOING stuff yourself.
Well, this tutorial just told me almost everything I need and I am now unstuck and very grateful to you. THANK YOU!
Nice, be free my friend. :)
@@Artindi I'll start by subscribing :)
Busy with my 2nd game and thought I should get to sound and music at some point, but remembering how awful it was implemented in my first game really put me off. Thanks, it was actually pretty useful.
Glad I could help. :)
now I know too - great stuff as always!
you absolute LEGEND never understood something so quickly
Agreed
Super helpful, thanks bawss!
Happy I could help! :D
You should make a video about music, but more in depth. A video talking about a concept for a system that plays music. However one that works for multiple songs. A music state machine if you will. That handles repeating the music and playing a new song. I had a simple system for it where you store the song name as a String. Then I auto loaded the script. I had a function called stop_music() which cleared the current track. The a play_song(name) function. The play_song called stop_music then I had a bunch of elif logic like if name == "song_one": $SongOne.play(). However this takes a long time to set up and it would be cool if you could find a better system for it. Just an idea. Nice video btw
I will be adding music to my game eventually, and it will be in a slightly more complex way then just music in the background... if everything goes to plan... so maybe after I do that I will have a bit more experience on the subject and be able to make a video on it. Great Idea! :)
@@Artindi that would be pretty cool
Simple. Love it. Subscribed. :)
Thanks bro, means a lot to me. :)
i love you!
I love you too. :)
Are you both marrying or not??
Thanks for the tutorial bro.
Nice man! Awesome!
No you! :)
thanks, its works for me.
Crunch Bars for the win.
Thanks man! i just added some music to my first horrible looking game :)))
THANK YOU!
YOU'RE WELCOME!
I literally cant get sound to play outside of the inspector tab, except when autoplay is checked
Things like this are super disheartening. Random things just stop working, or never work to begin with, and it makes me want to not do this any more. I have such great ideas for my game, and it's frustrating that they wont become real because of the non stop random hang ups.
I get error The method "get_global_mouse_position" isn't declared in the current class.
great tutorial thank you. but it gives me unexpected if in class body error for 20 and 21 line.
Do you have any solution for "listening" for audio from the player's position, rather than from the camera's position? There's a Listener node that works for 3D, but not for 2D....
hm... I haven't heard of that before, (sorry it took me this long to respond,) Seems like there aught to be something like that though because so many games, such as mobas, use stuff like that. If I find anything I'll let you know. :)
I am unable to add that sound
Drag sound to s...
Is there a way to let the same music keep playing when changing scenes? I have a main menu and a options menu and both are different scenes. I want the menu music to keep playing with no break when switching between them, but I also want completely different music ingame.
Yes, make a singleton, in godot they are called AutoLoads, (there are plenty of tutorials on how to make an autoload) and put your audio stream player there. Autoloads are scenes or scripts that are always running no matter what the active scene is. Very handy for things like inventories or save systems, as well as playing music between scenes. :)
@@Artindi Thanks a lot!!
how did you change your theme
has this changed much in the past 3 years?
if i have 2 audiostreamplayer2d child nodes how do i determine the x and y pos of the audio? so both are at different positions on the map? thanks!
I guess drag and drop them there? Or just change the transform. If I need the sound to come from a particular location in the game I might put a regular node in that location and then attach the audio node. But audioStreamPlayer2D nodes can already be placed wherever so you should be good. :)
@@Artindi Ah Good to know thanks!
hey, idk why but the sound effect keeps playing over and over and it's not in autoplay
Try looking at the import, on some audio files the import can be set to auto repeat. select the audio file, then open the import tab, uncheck the box that says repeat, and then click reimport, hopefully that works for ya.
Can you put the audio file in the description cause ive been trying to find audio for my game and i still have not found any yet
The audio file I use in this video is a little song I think I wrote. You're needing music for your game? Maybe I didn't understand.
Can you make a tutorial on cloning other populer games in godot. Fan made Sprite sheets are available online for free. You can start with Mario then hollow knight then plant vs zombie then ... I think you get the point. You can turn it into a series if you want. You don't have to make a complete one to one copy just one or two game mechanics that are unique to that game. Like Mario has variable jump hight and acceleration or in hollow kinght the pogo mechanic (when hit downward on a spike it pushes the character upward) you have covered many of them in the past too like wall slide and double jump (my Favorite)
That would be cool. I like the idea, I'll write it down, eventually I plan to have some sort of connected series more then just random tutorials, but I guess we will see what that ends up being. Thanks! :D
how do you play sound in specific parts like when shooting a gun we play the gun sound
Add the code to play the sound next to the code that shoots the bullet.
@@Artindi ok
i need some small help
i've got my bg music in another scene which is always loaded
and i wanna try to pitch it down when my player is hit for the death screen as a sadder tone
but i am struggling trying to find anything on how to shift the pitch using the code
You could use a Tween on the .pitch_scale attribute of the AudioStreamPlayer node. I think that should work.
@@Artindi how would i use it from my player hit detection script to link to the audio in another scene
sorry i'm still very brand new to this and figuring out how things work
@@SydneyPawYT If you are using a Autoload then you can call the functions in that script from any script. That's what I do, just make an auto load script with your music and whatever functions you might need to play/stop or adjust the song, then you can call those functions from anywhere.
when i am testing my project. its has sound, but when i exported it ... its has no sound... what am i doing wrong. i am using ubuntu 20
Not sure man, if the sound files are normal then it must be how you are exporting it or how your operating system works. have you sent your project to a computer with windows to see if the sound works there? because I don't know if there is a export option for ubuntu 20.
ty
np
i like how you didnt show how you got the file into godot thanks buddy
Are you fr? You just drag the file into godot…. Or drag it into the folder your godot project is in… you really need a video to tell you how to do that?
I wanna add sound like a crash when I hit something
How can I do that pls help me
Just follow the tutorial! :D have the sound play in the part of the code when a collision is detected.
@@Artindi no its not
@@Mohamed88Hassan What do you mean?
@@Artindi i mean the sound just keep playing after i add it
it doesn't stop keep repeating i just wanna make the player get hit by vase like crash once but i cant
🤣
@@Mohamed88Hassan Maybe you have the if statement shown in the video when you don't need it? Not sure, I would need to see your code to really help. :/
Is there a way to detect if a sound is playing near by?
probably not in the way that ears work, but you can detect if specific sounds are playing, and then you can check to see how far away they are. I think it may be a system that you would have to build yourself. There might be a way to do it, but sadly I have no idea what that might be. sorry. :/
make a new version. this is outdated now.
how the fuck do I store clips?
awesome, thanks!