Add Sound and Music! - Godot Tutorial - Now You Know Too

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024

ความคิดเห็น • 74

  • @Artindi
    @Artindi  4 ปีที่แล้ว +26

    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.

  • @calliedesu
    @calliedesu 2 หลายเดือนก่อน

    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!

  • @truechampignon6459
    @truechampignon6459 3 ปีที่แล้ว +3

    you absolute LEGEND never understood something so quickly

  • @dramkilgallen5237
    @dramkilgallen5237 2 หลายเดือนก่อน

    i like how you didnt show how you got the file into godot thanks buddy

  • @murraymon
    @murraymon 8 หลายเดือนก่อน

    has this changed much in the past 3 years?

  • @andriivedmid
    @andriivedmid 2 ปีที่แล้ว

    THANK YOU!

    • @Artindi
      @Artindi  2 ปีที่แล้ว

      YOU'RE WELCOME!

  • @Maltebyte2
    @Maltebyte2 ปีที่แล้ว

    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!

    • @Artindi
      @Artindi  ปีที่แล้ว

      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. :)

    • @Maltebyte2
      @Maltebyte2 ปีที่แล้ว

      @@Artindi Ah Good to know thanks!

  • @subhashchandrabose315
    @subhashchandrabose315 4 ปีที่แล้ว

    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

    • @Artindi
      @Artindi  4 ปีที่แล้ว

      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.

  • @jackmakmorn
    @jackmakmorn 4 ปีที่แล้ว +30

    Great, thanks. Now the first step out of silence has been done within my game :D

    • @Artindi
      @Artindi  4 ปีที่แล้ว +6

      That's one small step for dev.... one... giant leap... for dev-kind.

  • @binglebangle230
    @binglebangle230 2 หลายเดือนก่อน +1

    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.

  • @IvanIvan-nj2to
    @IvanIvan-nj2to 4 ปีที่แล้ว +7

    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

    • @Artindi
      @Artindi  4 ปีที่แล้ว +3

      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! :)

    • @IvanIvan-nj2to
      @IvanIvan-nj2to 4 ปีที่แล้ว +1

      @@Artindi that would be pretty cool

  • @PleepusPlopus
    @PleepusPlopus 4 ปีที่แล้ว +9

    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.

    • @Artindi
      @Artindi  4 ปีที่แล้ว +1

      Glad I could help. :)

  • @diynevala
    @diynevala 2 หลายเดือนก่อน +1

    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!

    • @Artindi
      @Artindi  2 หลายเดือนก่อน

      Nice, be free my friend. :)

    • @diynevala
      @diynevala 2 หลายเดือนก่อน

      @@Artindi I'll start by subscribing :)

  • @relunxet
    @relunxet 7 หลายเดือนก่อน

    great tutorial thank you. but it gives me unexpected if in class body error for 20 and 21 line.

  • @sangeeta3729
    @sangeeta3729 3 ปีที่แล้ว +1

    I am unable to add that sound
    Drag sound to s...

  • @nintendoloverin9567
    @nintendoloverin9567 2 ปีที่แล้ว +1

    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.

    • @Artindi
      @Artindi  2 ปีที่แล้ว +5

      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. :)

    • @nintendoloverin9567
      @nintendoloverin9567 2 ปีที่แล้ว

      @@Artindi Thanks a lot!!

  • @halexp
    @halexp 3 ปีที่แล้ว +3

    i love you!

    • @Artindi
      @Artindi  3 ปีที่แล้ว +1

      I love you too. :)

    • @godot-boy7694
      @godot-boy7694 3 ปีที่แล้ว +1

      Are you both marrying or not??

  • @TheUltimateD00mer
    @TheUltimateD00mer 4 หลายเดือนก่อน

    make a new version. this is outdated now.

  • @RegenerationOfficial
    @RegenerationOfficial ปีที่แล้ว

    how the fuck do I store clips?

  • @jonpwoodward
    @jonpwoodward 3 ปีที่แล้ว +1

    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....

    • @Artindi
      @Artindi  3 ปีที่แล้ว +2

      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. :)

  • @lionstarwolf1535
    @lionstarwolf1535 ปีที่แล้ว

    hey, idk why but the sound effect keeps playing over and over and it's not in autoplay

    • @Artindi
      @Artindi  ปีที่แล้ว

      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.

  • @javgroman
    @javgroman 4 ปีที่แล้ว +2

    now I know too - great stuff as always!

  • @scoopydevy
    @scoopydevy 3 ปีที่แล้ว +1

    how did you change your theme

  • @educationaltutorials8218
    @educationaltutorials8218 2 ปีที่แล้ว

    I get error The method "get_global_mouse_position" isn't declared in the current class.

  • @rcmlit9767
    @rcmlit9767 2 ปีที่แล้ว +1

    how do you play sound in specific parts like when shooting a gun we play the gun sound

    • @Artindi
      @Artindi  2 ปีที่แล้ว

      Add the code to play the sound next to the code that shoots the bullet.

    • @rcmlit9767
      @rcmlit9767 2 ปีที่แล้ว

      @@Artindi ok

  • @SydneyPawYT
    @SydneyPawYT ปีที่แล้ว

    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
      @Artindi  ปีที่แล้ว

      You could use a Tween on the .pitch_scale attribute of the AudioStreamPlayer node. I think that should work.

    • @SydneyPawYT
      @SydneyPawYT ปีที่แล้ว

      @@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

    • @Artindi
      @Artindi  ปีที่แล้ว

      @@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.

  • @IvanIvan-nj2to
    @IvanIvan-nj2to 4 ปีที่แล้ว +1

    Crunch Bars for the win.

  • @anthonygill718
    @anthonygill718 3 ปีที่แล้ว +2

    Simple. Love it. Subscribed. :)

    • @Artindi
      @Artindi  3 ปีที่แล้ว +1

      Thanks bro, means a lot to me. :)

  • @tatterdemalion898
    @tatterdemalion898 3 ปีที่แล้ว

    Thanks man! i just added some music to my first horrible looking game :)))

  • @Mohamed88Hassan
    @Mohamed88Hassan 2 ปีที่แล้ว

    I wanna add sound like a crash when I hit something
    How can I do that pls help me

    • @Artindi
      @Artindi  2 ปีที่แล้ว

      Just follow the tutorial! :D have the sound play in the part of the code when a collision is detected.

    • @Mohamed88Hassan
      @Mohamed88Hassan 2 ปีที่แล้ว

      @@Artindi no its not

    • @Artindi
      @Artindi  2 ปีที่แล้ว

      @@Mohamed88Hassan What do you mean?

    • @Mohamed88Hassan
      @Mohamed88Hassan 2 ปีที่แล้ว

      @@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
      🤣

    • @Artindi
      @Artindi  2 ปีที่แล้ว +1

      @@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. :/

  • @bananatree8763
    @bananatree8763 2 ปีที่แล้ว

    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

    • @Artindi
      @Artindi  2 ปีที่แล้ว

      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.

  • @hoppalapasam53
    @hoppalapasam53 3 ปีที่แล้ว

    thanks, its works for me.

  • @mayankprasoontirkey369
    @mayankprasoontirkey369 4 ปีที่แล้ว +2

    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)

    • @Artindi
      @Artindi  4 ปีที่แล้ว +2

      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

  • @fdevstudio5692
    @fdevstudio5692 3 ปีที่แล้ว

    Thanks for the tutorial bro.

  • @Marandal
    @Marandal ปีที่แล้ว

    Super helpful, thanks bawss!

    • @Artindi
      @Artindi  ปีที่แล้ว +1

      Happy I could help! :D

  • @SaiponathGames
    @SaiponathGames 3 ปีที่แล้ว

    Nice man! Awesome!

    • @Artindi
      @Artindi  3 ปีที่แล้ว

      No you! :)

  • @badmonkey2468
    @badmonkey2468 4 ปีที่แล้ว

    ty

  • @canaldosoninho
    @canaldosoninho 4 ปีที่แล้ว +1

    Is there a way to detect if a sound is playing near by?

    • @Artindi
      @Artindi  4 ปีที่แล้ว

      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. :/

  • @animanoir
    @animanoir 2 ปีที่แล้ว

    awesome, thanks!