Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Feature Request AudioSource.PlayOneShot should accept an AudioResource parameter

Discussion in 'Audio & Video' started by theboxfriend, May 3, 2024.

  1. theboxfriend

    theboxfriend

    Joined:
    Jun 7, 2021
    Posts:
    3
    AudioRandomContainer and its base class AudioResource were introduced to the engine fairly recently and can be assigned to an AudioSource to play a random sound. However, if you want to use more than one random sound you need more than one AudioSource because the PlayOneShot method does not yet accept an AudioResource as a parameter
     
    flogram and the_lost_bear like this.
  2. theboxfriend

    theboxfriend

    Joined:
    Jun 7, 2021
    Posts:
    3
    Another method that needs support for AudioResource is PlayClipAtPoint as well as any other AudioSource method that accepts an AudioClip