|
Post by spikeyuk on Oct 11, 2019 19:11:36 GMT
I’m hoping someone can help...
I have two different game objects, both with an ambient sound on which uses the same sound group (single sound variation with multiple voices set). The clip is set to loop. When these objects are in the scene both play an instance of my sound clip and both loop ok. If I make one of the objects inactive (setInactive in code) it stops all instances of that sound playing (and no new game objects using the same group will play from that point on).
Should I be doing something different here? It’s worth pointing out that when I make the object inactive it is still within hearing range and so the clip is still playing, not sure if that has a bearing?!
Any help would be appreciated!
|
|
|
Post by DarkTonic Dev on Oct 11, 2019 19:16:49 GMT
I've actually fixed that bug for the next release already. I can make a release on Monday.
If you can't wait, then email us at support@darktonic.com with your Asset Store Invoice PDF requesting the beta.
Thanks.
|
|
|
Post by spikeyuk on Oct 11, 2019 19:31:52 GMT
Awesome, it had me scratching my head for a while!
I’ll keep an eye out for the release next week.
Thanks for the super quick reply!
|
|
|
Post by DarkTonic Dev on Oct 11, 2019 19:37:43 GMT
No problem.
|
|
|
Post by spikeyuk on Oct 14, 2019 9:31:58 GMT
This works great now thanks...but the issue I now have is that when the camera moves, the sounds never to go in range for the ambient script to trigger. It's as if the listener is not moving with the camera. Any ideas?
|
|
|
Post by DarkTonic Dev on Oct 14, 2019 15:29:38 GMT
Negative, it works perfectly for me you will have to send me an example scene with the bug you are describing if I am to be able to reproduce or fix it.
I would just watch the colliders in scene View and see if they are actually overlapping or not.
|
|
|
Post by spikeyuk on Oct 15, 2019 11:55:57 GMT
Ok so I'm thinking perhaps I'm doing something wrong...
I have multiple game objects each with an Ambient Sound script on, all using the same sound group. The group has multiple voices available with a single variation. After a while the following method gets called:
PerformTriggerExit
and for which I have 'stop sound' set which calls:
StopSoundGroupOfTransform
but this stops all instances of the sound group even though they are playing from multiple transforms. Should I only ever have one sound group per game object? I'm thinking I have this set up incorrectly...
|
|
|
Post by DarkTonic Dev on Oct 15, 2019 15:53:31 GMT
That sounds like it would work fine. StopSoundGroupOfTransform will only stop the Sound Group you specify that's "playing from" the same Transform. But it happens, you can see what's playing on what using the diagnostic tools. www.dtdevtools.com/docs/masteraudio/Troubleshooting.htmIn particular, the Audio Transform Tracker will show you what's playing on that Game Object. There's even buttons on it to "Stop All Sounds" and test it there.
|
|
|
Post by spikeyuk on Oct 18, 2019 17:17:51 GMT
Ok so tracked down the issue but not sure what's causing it, just before all the sounds stop the following is called with a null transform...
public static void StopSoundGroupOfTransform(Transform sourceTrans, string sType)
All my gamobjects with ambient script are set to follow caller and none are destroyed, just marked inactive (I have an object pool for them).
Any ideas? I can put a check in that method to return if transform is null but not sure if that will cause further issues...
|
|
|
Post by DarkTonic Dev on Oct 18, 2019 18:17:29 GMT
If the transform is null, it's probably destroyed (Scene ended?). Disabling does not null a Transform. Again, you will need to send me an example Scene for me to figure it out.
|
|