Search Unity

Change Audio Clip Drag Drop Behavior

Discussion in 'Wish List' started by HeywoodFloyd, Nov 23, 2009.

  1. HeywoodFloyd

    HeywoodFloyd

    Joined:
    May 27, 2009
    Posts:
    16
    It would be better if every time you dragged an audio clip to a GameObject, it created its own AudioSource.

    Currently, when you drag an audio clip to a GameObject, it creates an AudioSource, as it should. Dragging additional audio clips changes the clip in that audio source. If you want multiple audio clips for a GameObject, you need to use the top pulldown menu to make an AudioSource for every clip. If you've got an object with lots of audio, e.g., an AI player with a lot of things he can say, this takes a lot of time.
     
  2. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Using more than one Audio Source per Game Object, as with any other component, is generally a terrible idea. Create an array of audio clips and assign the appropriate one to the audio source as necessary.
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Agreed.

    --Eric
     
  4. HeywoodFloyd

    HeywoodFloyd

    Joined:
    May 27, 2009
    Posts:
    16
    Okay, I promise never to put multiple AudioSources on a single GameObject. (Just curious; why's that so bad? Does it hit memory, performance?)

    It would be nice, though, if AudioSource had a bank of clips, kind of like Animation has a bank of animations that can be played.
     
  5. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    It doesn't help, but I bet that this aspect is negligible, compared to the amount of memory all the sounds are going to take up. My main issue is just that you can't rearrange the order of components in the Inspector, making multiple instances of any component a pain. It's obviously not "the Unity way".

    I think that's reasonable.