Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Multiple AudioSources or change audio Clip?

Discussion in 'Audio & Video' started by Zocker1996, Mar 28, 2016.

  1. Zocker1996

    Zocker1996

    Joined:
    Jan 12, 2015
    Posts:
    20
    I'm developing a mobile game.
    I got a barrel rolling on the ground and as long as it's rolling it plays its rolling sound.
    But as soon as it drops I need it to play the dropping sound for a while and then start playing the rolling sound again.

    I'm going to have several barrels and since I havent worked with sound before I need to know:

    Is it better (for performance) to use one AudioSource and change the clip or use a seperate AudioSource for each clip?
     
  2. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,014
    Well it's strange to put more than one Audio Source on a single game object. Personally we put all Audio Sources on a central game object.

    I believe that with Unity 5, the number of Audio Source not playing anything doesn't have any real impact on audio memory or performance.