How to Add MUSIC and SOUND EFFECTS to a Game in Unity | Unity 2D Platformer Tutorial #16
Vložit
- čas přidán 25. 08. 2024
- In this Unity 2D Tutorial we'll learn How to add MUSIC and SOUND EFFECTS to a Game.
In this Audio Manager Tutorial we'll add background music and various sound effects to our 2D Platformer game. We'll Create very simple Audio Manager C# Script to control music and SFX.
Enjoy the video ☕
----------------------------
🖐 Hi Game developer
Welcome to Rehope Games I'm Murat
I share unity tutorial videos on my channel. if you want to make a game with unity (especially 2d platformer game), the videos here will definitely interest you.
----------------------------
#unitytutorials, #unity2d, #unity2dplatformer
I swear the tutorials that are the most helpful are so underrated and low views, you have no idea how much this helped me. THANK YOU!
I'm glad it helped you 😊
Thanks for your nice feedback 🙏
Thanks, this is a short and simple tutorial that doesn't overcomplicate things. Those are hard to find these days.
Love your C-Krypt tutorial bro 😂😂
This is the only tutorial where I smile and learn at the same time, looking more from you! 💯
Thank you so much bro , I'm glad hear that.
You are so kind , Smile all your life. 😊
This was so clear and helpful, thank you
Glad it was helpful 😊
Thanks for your nice feedback 🙏
"Sicript" lmao brooo... but dont worry the tutorial is cool, thanks!
Thanks 😅
i like that sound 😊
5:14 Well played Sir... and thank you for the video
ı have discovered this channel recently,it's so useful thanks;
Welcome 😊
thank you very much. you made my day so much better
Thanks for the nice feedback 😊
@@RehopeGames I have some quick questions. How do you play a song audio when a text UI reaches a certain number? Ive been looking everywhere and I couldnt find anything. I want to play a sound when a player reaches 5 points and repeat it every 5 points or multply to increase the score quota and play a song. like a player scores 5 and a song will play and then next time if he scores 15 the song will play and then 30 etc etc. And I want to be able to play a song just one time too.
This is for c# in unity of course.
thanks i'm starting to make my own 2d game
Really thank you.
very nice! Thank you !
Thanks so much ! Nice video Sir !!
Nice. Also randomize the pitch of the sound fx. So it can sound slightly different each time.
when adding SFX sounds.
And trying to write code GetComponet.
I kept getting a error and was not able to add SFX this way.
Had to use a SRC Component which let me add SRC Sounds to my script and then use them in code.
If anyone know why I was getting that error on FindGameObjectWithTag line.
Was getting error on GetComponent audioManager.
Thank You !!!!!! for this tutorial.
Great tutorial appreciated!
Thanks 😊
this is so helpfull , Thankyou very much
Dostum ellerine sağlık çok yardımcı oldun çok teşekkür ederim 💙
Güzel yorumun için ben teşekkür ederim kardeşim 😊
Hocam yaptığınız oyun gerçekten çok güzel görünüyor ellerinize sağlık :)
Teşekkürler 😊
@@RehopeGames hocam birde 6:04'de particles diye bir script doyasından değiştiriyorsunuz ama benim öyle bir script dosyam yok oluşturmam mı gerek illaki çünkü sadece death ve background music eklemek istiyorum
Amazing tips!
Thanks for the feedback 🙏
THANK YOU SO MUCH!!!!
Got a new subscriber.
Welcome 😊
Tomorrow I sit down to my platformer and add stuff from this series. Seriously, I discovered this channel today, and it's perfect when it came to us making a platformer. Could you make a tutorial for levels like in Dadish? It means that we can choose a level in the menu and when we beat one level we go to another. That would be really useful. Also, if you did a video like this, could you explain how I can add something to it before going to the next level?
I know I'm asking for too much (lol) but I am currently learning to program and it would be very useful to me, because I know Unity, but only the basics of C# and i cant create good scripts, only veerry basic. Sorry for the long comment and requests. If ever my platformer succeeds and be very big game, it's your fault too. And other CZcamsrs.
I forgot to add that I think you deserve more subscribers and publicity. What you do is at a high level, and communication with viewers is very good.
Thanks for this long paragraph. 😊
I'm gonna add Level map and other UI system to the game.
I'm also thinking of shooting different kinds of game making series.
I hope this channel helps you😉
Thank you so much for your nice comment , that is valuable for me 😊
@@RehopeGames thanks for reply 😁 Glad you're continuing this series and adding more things.
Great to find your chanel👍🏻
Thanks and welcome 🤗
Hi Rehope! Awesome tutorial, thank you
1:18 Gorilla tag SFX
How did you declare it as AudioManager audioManager? Mine doesn't recognize the namespace AudioManager? How can I fix this?
Hey, how do you make it so the background music loops when done?
This is an awesome tutorial, I am only running into one issue. I am making a game with zombies, and i have an audio clip play when a zombie sees me. The problem is that when multiple of the same audio play, it gets super loud and distorted for some reason. I am unsure as to why. I hope you can help me ;)
It really just seems to be a issue when they overlap, any idea of how i could fix this?
Also what would be the best way to edit thhe volume for specific sounds?
why on my visual script kinda different about this 3:32, am i get something wrong?
nice tut bro
Hello, I have tried your tutorial, but I encounter a problem, I have changed the script to make it destroy the audio manager in scene 2, so there's duplicated audio manager, only the one from scene 1 will be active.
the song is keep playing continuously , but the the sfx I assigned to my buttons in scene 2 don't work, it show missing (object), even tho there audio manager (from scene 1).
it will be really appreciated if you help me to solve this :)
i cant drag and drop the SFX Source in the missing audio source pls help
keep it up
Thanks 🙏
why mine sounds doesnt play, i try to call it in other scripts but nothing happened, i already add audio listener in main camera
There can be many reason for this, plz make sure you are following the video step by step.
@@RehopeGames i put it on the wrong script , i forgot to remove it and thought i still use that script, spend for few hours wondering why my code doesn't work, and thanks for the knowledge!
Hello why wont the audio play on my game?
Why does it work only when i put my audio inside the "Audio Source" Component, unlike yours?
Hello sorry for the late reply. I hope you solved it 🙏
@@RehopeGames no I haven't solve it, and yes I already follow you step by step and Still didn't work
I know I'm four months late, but I think you have to do the song like this:
using UnityEngine;
public class MusicConverter : MonoBehaviour
{
[Header("Audio Source")]
[SerializeField] AudioSource musicSource;
[SerializeField] AudioSource SFXSource
[Header("BGM")]
public AudioClip BGM;
public AudioClip Death;
[Other SFX here]
private void Awake()
{
DontDestroyOnLoad(gameObject);
}
private void Start()
{
musicSource.clip = BGM;
musicSource.Play();
}
}
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
If you have any more Sound Effects, put them in the spot that says "[Other SFX here]"
Hello. What is the format of the music file you used?
Hello 👋
I used WAV format.
Hey Rehope, my code is giving me a error when I use the GetComponent
Its saying that 'GameObject[]' does not contain a definition for 'GetComponent' and no accesibl extension method 'GeComponent' accepting a first argument of type 'GameObject[] ' could be found
How can I fix this ? - I'm using Unity 2020.3.30f1 (btw)
Hey 👋
Can you show me your script?
Thank you so much for replying, re-watching your video, I actually found the error lol. It was way simpler then I thought but still, thanks for the amazing video !!@@RehopeGames
👍
what was the fix I encountered the same error
@@ssalamandr4
I have the same problem, and i don't find which is the error, how did u solve it?
How can I continue playing my music in other scene?
Hello,
This video is about that 👍 czcams.com/video/xswEpNpucZQ/video.html
adamsın kanka
What if the audiomanager has different scenes?
Hello Muhammad , maybe this video can help you czcams.com/video/xswEpNpucZQ/video.html
@@RehopeGames thank you so much
casual game sound arent these gorilla tag sounds
Script❌Siciript✅
how to add more than one musicsource?
Duplicate it With CTRL+D Shortcut 😊
If you give me detail about what you wanna , maybe I can help you 🙏
@@RehopeGames thanks, I've done it with a condition
@@MuhammadHsby 👍
lütfen kodlarıda ekle
Code source unity de game please
merhaba hocam turkmusunuz?
Merhaba,
Evet Türküm 😊
@@RehopeGames hocam bütün videolarinizi izledim gercekten en iyi kanallardan birisiniz öğretim kısmında 😁 2 yıldır unity kullanıyorum bilmedigim seyler öğrendim
@@hamsterserdar197 Faydalı olabildiysem ne mutlu bana 😊Oyun yapım sürecinizde başarılar dilerim.
@@RehopeGames çok saolun hocam bir sorun var bende sizin kaç yıllık 2d tecrubeniz olur diye düşünüyorum benim bu oyunda bir sorun var isterdim bu sorunu özel hesaplarinizdan bildiriyim belki sorunun çözümünü bilirsiniz
@@hamsterserdar197 6 yıldır unity ile oyun geliştiriyorum. Mail adresime atabilirsiniz (RehopeGames@gmail.com). Bilfdiğim birşeyse yardımcı olmak isterim
comawn what are you doing in the particle controller?
get out of there 😭
😂
kiss me
🖐😂
Si cript
I will share all assets soon.
Thanks for your interest.