PLEASE use a Unity SOUND MANAGER! - Full Tutorial

Ойындар

Sound Managers are crucial when using audio sources in Unity. It really helps to organise your sound events in a structured way!
Github Code: github.com/SmallHedge/SoundMa...
*LIGHT FLICKER ULTIMATE* assetstore.unity.com/packages...
Assets Showcased:
LIGHT FLICKER: assetstore.unity.com/packages...
BACKGROUND: assetstore.unity.com/packages...
WIZARD: assetstore.unity.com/packages...
PLAYER: assetstore.unity.com/packages...
SOUND FX: assetstore.unity.com/packages...
FOOTSTEPS: assetstore.unity.com/packages...
FULLSCREEN: assetstore.unity.com/packages...
Support me :) - buymeacoffee.com/smallhedgehq
Website - www.smallhedge.com/
My games - small-hedge.itch.io
Twitter - / smallhedgehq
Facebook - / smallhedgehq
KZread avatar created by OliGalArt, go check her out! ko-fi.com/oligalart/commissions
00:00 Intro
00:19 What is a SoundManager?
00:43 Example Scene
00:59 What are we doing today?
01:27 Into Unity
01:35 Light Flicker Ultimate
01:57 CHAPTER 1: FUNCTIONALITY
02:37 Sound Enum
02:59 Getting the Audio Source
03:21 Audio Clips
03:40 PlaySound() Method
04:39 Passing in Audio Clips
05:09 Lets try it out!
05:41 CHAPTER 2: ANIMATOR
06:06 PlaySoundEnter/Exit Scripts
07:10 Lets try it out!
07:36 Adding all the sounds in
07:57 Lets try it out!
08:12 FOOTSTEPS
09:08 CHAPTER 3: INSPECTOR
09:37 Multidimentional Arrays in Inspector
10:58 Renaming Inspector Array Names
11:35 Renaming Array Names in Code
13:47 WOAH ITS MAGIC!
14:09 Adding Sounds
14:18 Updating PlaySound() Method
15:42 WE DONE IT!

Пікірлер: 30

  • @Equisdeification
    @Equisdeification16 күн бұрын

    Nice video! A simple dictionary of that you create at runtime feels much easier to read. Also be careful with having all your sounds in a single script, specially on mobile, because if the game grows, this means having all the game audio loaded into memory from the start, even sounds that you don't even need in the current scene

  • @blindsidedgames
    @blindsidedgames3 ай бұрын

    Man, I didn't know I could reference instanced non static methods that way. Works with variables too I like that. You taught me much today Senpai.

  • @alicia8382
    @alicia83822 ай бұрын

    this is such a good tutorial, seriously so helpful! love how you structure the video and actually show the features you're talking about at the START of the video. it helps so much to know if this tutorial is something i'm looking for. super easy to follow! thanks for sharing this for people like me to learn and follow along for free!!!

  • @SmallHedgeHQ

    @SmallHedgeHQ

    2 ай бұрын

    Thank you so much!!

  • @theswiftbuilds
    @theswiftbuilds3 ай бұрын

    this is awesome, i wish i knew this earlier! you earned a sub :)

  • @HarrenTonderen
    @HarrenTonderen3 ай бұрын

    Nice! Btw one thing i like to add with audio players is random pitch - usually storing it as Vector2 (so X/Y are min/max, 1f/1f as default) and change AudioSource's pitch with random range when play function is called. Small but fun thing, however unsure how it affects perfomance in any case..

  • @SmallHedgeHQ

    @SmallHedgeHQ

    3 ай бұрын

    That is a great idea! It would definitely make the sounds feel more authentic.

  • @kunal-ko
    @kunal-ko3 ай бұрын

    You're a genius

  • @rofu8096
    @rofu80963 ай бұрын

    I FOUND A FUCKING GEM THANK YOU GEM

  • @Anerisian
    @Anerisian3 ай бұрын

    This seems really good, but I think the soundlist step, if not the enum should be scriptable objects.

  • @SmallHedgeHQ

    @SmallHedgeHQ

    3 ай бұрын

    Yeah, an array of scriptable objects would also work.

  • @vatyunga

    @vatyunga

    3 ай бұрын

    @@SmallHedgeHQ No, you don't really need an array of scriptable objects. You just pass a scriptable object containing array of sounds to sound manager. And you reference them in PlaySoundEnter / PlaySoundExit and everywhere else like you usually reference scriptable objects. [SerializeField] private SoundScriptableObject _hurtSound; AudioManager.Play(_hurtSound, volume);

  • @RoxGame
    @RoxGame3 ай бұрын

    can this system play background music while playing another sound effects using one audio source !

  • @SmallHedgeHQ

    @SmallHedgeHQ

    3 ай бұрын

    This SoundManager is optimised for event-based sound effects. Such as playing a sound when criteria are met. For background music, I have a couple of suggestions. 1. Create a separate audio source and set it to looping. When the music needs to be triggered, call AudioSource.Play() and AudioSource.Stop() when it needs to stop. 2. Change the play method to SoundManager.Play(Sounds sound, float volume, bool looping). Then if looping is true, create a Coroutine which calls SoundManager.Play() again after the duration of the audio clip. Of course with this way, you’ll need a way to stop the looping, so there’ll need to be a new Stop() method which interrupts the Coroutine. I would strongly recommend #1. Unless you are looking to use the SoundManager script to manage all the sound/music in your project. I think the best way is a hybrid approach.

  • @jaulloa21
    @jaulloa213 ай бұрын

    The light flicker asset is simply a spotlight that dims on and off. :} 😅

  • @SmallHedgeHQ

    @SmallHedgeHQ

    3 ай бұрын

    xD. I should ask the developer to add more features! Its selling point is it’s completely customisable. You can flicker colour, flicker materials, add sound, and trigger events all in just one state. You can add an infinite amount of these states that do anything you want. I genuinely use this asset in most of my projects because of how versatile it is! Would recommend checking out the tutorial video on the Unity Asset Store to see all the features :)

  • @LotionSoronarr
    @LotionSoronarr3 ай бұрын

    Why not use Scriptable Objects? Sounds lists in scriptable objects. Every characters gets it's own sound list.

  • @weckar

    @weckar

    3 ай бұрын

    Depending on application. This is more generic, and requires fewer additional assets as overhead.

  • @pablovillegas2898
    @pablovillegas28986 күн бұрын

    Nice video but i have a problem, How can I lower the volume of the walking sound independently?, my walking sound is very loud and I would like to decrease it without altering the others

  • @SmallHedgeHQ

    @SmallHedgeHQ

    4 күн бұрын

    I actually found this exact issue! On the GitHub link, you can now change each sound volume in the Unity inspector, as well as its audio mixer. So the sound manager shown in the video is a little bit outdated.

  • @pablovillegas2898

    @pablovillegas2898

    3 күн бұрын

    @@SmallHedgeHQ Oh, ok i'll try it

  • @darkman237
    @darkman2372 ай бұрын

    Could you refactor this to use unity events?

  • @SmallHedgeHQ

    @SmallHedgeHQ

    2 ай бұрын

    100%. The only prerequisite is the Play() method can not have more than 1 parameter. Could potentially create a scriptable object which holds Sounds enum and Volume, then pass in that.

  • @darkman237

    @darkman237

    2 ай бұрын

    @@SmallHedgeHQ In order to keep the sound enum and volume would have to be set dirty between plays

  • @AliHosseiniDev
    @AliHosseiniDev3 ай бұрын

    Meh. just use scriptable objects.

  • @weckar
    @weckar3 ай бұрын

    Wait. People do that? Make a sound source for every sound? What? You have got to be joking right?

  • @renarsgrams

    @renarsgrams

    3 ай бұрын

    Yes, I do. 😄 That's what happens when you learn something new. It was a way I could think of to play five sounds at the same time for one object. But now I will try this way.

Келесі