社区问答

欢迎来到 Audiokinetic 社区问答论坛。在此,Wwise 和 Strata 用户可互帮互助。如需我们团队直接提供协助,请前往技术支持申请单页面。若要报告问题,请在 Audiokinetic Launcher 中选择“报告错误”选项(注意,问答论坛并不会接收错误报告)。我们内部设有专门的错误报告系统,会有专人查看报告并设法解决问题。

要想尽快得到满意的解答,请在提问时注意以下几点:

  • 描述尽量具体:比如,想达到什么样的目的,或者具体哪里有问题。
  • 包含关键细节:比如,Wwise 和游戏引擎版本以及所用操作系统等等。
  • 阐明所做努力:阐明自己为了排除故障都采取了哪些措施。
  • 聚焦问题本身:聚焦于问题本身的相关技术细节,以便别人可以快速找到解决方案。

0 投票
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...
分类:General Discussion | 用户: Matt sneakSounds (460 分)

1个回答

0 投票
 
已采纳
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.
用户: Benoit S. (Audiokinetic) (16.0k 分)
采纳于 用户: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
...