Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Alanimator · Jul 01, 2014 at 04:17 AM · c#audio

What is the best way to handle spawned audio sources ?

There are usually 2D sounds wich are set to play on awake and loop throughtout gameplay . I'm fine with that.

but when it comes to playing 3D sounds on something like a rocket i'm wondering if i should just say AudioSource.Play()

or should I spawn a new AudioSource each time i fire the rocket and reduce the priority of each spawned audio source over time?

i'm thinking od spawning a new audio source for each pocket that is fired.

I'm not too sure of what to do.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Nerevar · Jul 01, 2014 at 10:52 AM 1
Share

Hello,

1) To play 3D sound, make sure you imported the rocket sound clip as a 3D sound.

2) Attach an audioSource to the rocket everytime you spawn one. Play and loop that clip.

" should I spawn a new AudioSource each time i fire the rocket and reduce the priority of each spawned audio source over time?" I don't understand what you mean with this :p

3) If it is a 3D sound, when the rockets are far you won't hear them anymore, You might have to set the 3D settings of your AudioSource at runtime to know what are the best settings for your game.

avatar image Alanimator · Jul 03, 2014 at 12:11 AM 0
Share

i'm not an audio expert lol (obvious truth) but AudioSource priority levels deter$$anonymous$$ed which audio is more audible , so if i have 20 audio sources playing at the same time , the one with the lowest priority may not be heard .

so if i fire off 20 rockets ,each having a spawned AudioSource without reducing the priority level of the previously spawned audio source over time then i may end up with choppy playback.

if i do attach an AudioSource to each rocket then it will sound as if the sound of a rocket being fired is on the rocket and not around what fired it , which is why i'm not sure of what to do .

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Passing Java String to C# for use in Wwise Post Event = Fail 0 Answers

PlayerPrefs not saving slider value & audio 2 Answers

Read audio/music currently playing on speakers? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges