Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

0 votes
We're using Unity 5 and TBE 3Dception and would like to know if it's possible to attach a 3D sound to a particle effect.

 

Cheers in advance...
in General Discussion by Matt sneakSounds (460 points)

1 Answer

0 votes
 
Best answer
A particle effect is a component, so it needs to be attached to a GameObject. Simply attach an AkAmbient component to the same GameObject as the particle effect.
by Benoit S. (Audiokinetic) (16.0k points)
selected by Benoit S. (Audiokinetic)
Hi Benoit and thanks for the quick response. My bad though, I should have been more specific... I meant is it possible to attach sounds to individual particles? The way we're using the particle system means we have very wide separation on each particle and I'd like to associate a sound with each of the individuals.
Unfortunately, individual particles are not GameObjects in Unity, so the simple answer is no. A quick Google search shows that this is not possible even with the built-in Unity audio.

However, with some scripting, you could achieve something. You have access to each particle's position and rotation (see here: http://docs.unity3d.com/ScriptReference/ParticleSystem.Particle.html ). You could (at init time) create a certain number (say, maxParticles of your Particle System if you want every single particle to play a sound) of empty GameObjects with an AkGameObj component attached to them. When you wish to post an event on a particular particle, you could get the particle's position, move an empty GameObject to that position, and then call AkSoundEngine.PostEvent using that GameObject.

If your sound is short, you don't need to do anything else. The sound will play at the particle's position, and then it's over. But if you want to play longer 3D sounds, you will need to keep updating your empty GameObjects' positions.

Be careful with this, though. If you have a big number of particles in your particle system, this will use a lot of memory and CPU!
Thanks very much for the help, I'll pass the info on to my coder and see wee what we can do.

All the best,
Matt
...