Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
2
Question by MikePatterson · Jan 27, 2014 at 10:48 PM · audioprogrammingparticlesystemparticleemitter

How can I play a sound every time a particle is emitted?

I know that this was formerly possible with

 function Update () {
     if (gameObject.particleEmitter.emit) {
         audio.Play();
     }
 }

But this doesn't seem possible anymore with the new particle system. Some have suggested syncing up the sound with the emissionRate but this seems like a sloppy mess if the emissionRate is going to be changed later. Any help would be much appreciated.

Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by Laumania · Aug 21, 2019 at 12:00 PM

I might be 5 years too late here, but in case others find this thread too - here is how I solved playing a sound when a particle is emitted and once it dies: https://www.youtube.com/watch?v=jKSz8JJnL4E

Hope somebody find it useful.

Enjoy!

Comment
Add comment · Show 2 · Share
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 nopogo · Jan 23, 2020 at 02:10 PM 0
Share

$$anonymous$$VP this is exactly what I needed just now :P

avatar image Laumania · Mar 15, 2020 at 02:35 PM 1
Share

I have done a new an updated video with a little more advanced script than in the previous one - hope it helps someone: https://www.youtube.com/watch?v=q_j$$anonymous$$iFHy93Y

avatar image
1

Answer by Dryrainstudios · Sep 03, 2015 at 01:23 AM

I know it was a while ago but did you see this? http://answers.unity3d.com/questions/693044/play-sound-on-particle-emit-sub-emitter.html

Comment
Add comment · Share
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
0

Answer by jblazer · Apr 22, 2014 at 04:55 PM

So I was looking for an answer to this with a looping particle system (Shuriken) and trying to sync audio to a timed interval loop. I was able to get something working - maybe a workaround to not having emit available… this basically plays a one-shot audio at the start of the particle loop… You may have to play with the .1 value - I recently noticed it was playing the sound more than once. Maybe put it in a fixed update loop instead and reduce this to a timed interval… but was able to get a working solution for our game with this method...

 var air : AudioClip;
 
 function Update(){
    if (particleSystem.time <= .1f){
    audio.PlayOneShot(air);
 }
 }
Comment
Add comment · Share
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

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

22 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 avatar image

Related Questions

Multiple Cars not working 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

ArgumentNullException: Argument cannot be null 0 Answers

How to adjust particle system (or Dust Storm if possible) properties from script? 1 Answer

Only play audio if it isn't already -- if (!audio.isPlaying) not working 2 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