PLEASE use a Unity SOUND MANAGER! - Full Tutorial

Поділитися
Вставка
  • Опубліковано 28 сер 2024

КОМЕНТАРІ • 30

  • @Equisdeification
    @Equisdeification Місяць тому +6

    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

  • @alicia8382
    @alicia8382 3 місяці тому +1

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

  • @blindsidedgames
    @blindsidedgames 4 місяці тому +1

    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.

  • @HarrenTonderen
    @HarrenTonderen 4 місяці тому +1

    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  4 місяці тому

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

  • @Anerisian
    @Anerisian 4 місяці тому +1

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

    • @SmallHedgeHQ
      @SmallHedgeHQ  4 місяці тому

      Yeah, an array of scriptable objects would also work.

  • @rofu8096
    @rofu8096 4 місяці тому +3

    I FOUND A FUCKING GEM THANK YOU GEM

  • @theswiftbuilds
    @theswiftbuilds 4 місяці тому

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

  • @jaulloa21
    @jaulloa21 4 місяці тому +1

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

    • @SmallHedgeHQ
      @SmallHedgeHQ  4 місяці тому +1

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

  • @weckar
    @weckar 4 місяці тому +2

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

    • @renarsgrams
      @renarsgrams 4 місяці тому

      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.

  • @kunal-ko
    @kunal-ko 4 місяці тому

    You're a genius

  • @LotionSoronarr
    @LotionSoronarr 4 місяці тому +1

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

    • @weckar
      @weckar 4 місяці тому

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

  • @pablovillegas2898
    @pablovillegas2898 Місяць тому

    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  Місяць тому

      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 Місяць тому

      @@SmallHedgeHQ Oh, ok i'll try it

  • @AliHosseiniDev
    @AliHosseiniDev 4 місяці тому +12

    Meh. just use scriptable objects.

  • @darkman237
    @darkman237 3 місяці тому

    Could you refactor this to use unity events?

    • @SmallHedgeHQ
      @SmallHedgeHQ  3 місяці тому

      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 3 місяці тому

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

  • @Clovenweb
    @Clovenweb 16 днів тому

    tbh just used first part of video🤣

  • @RoxGame
    @RoxGame 4 місяці тому

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

    • @SmallHedgeHQ
      @SmallHedgeHQ  4 місяці тому +1

      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.