It seems "Max distance" minimum value is 10. Is there a reason for this limitation?
I use Ambient sound for a AI enemy to emit sound so that player can hear when it's nearby. For my use case I'd need the sound "Max distance" to be smaller, maybe around 5 so that player could not hear the enemy too far away.
Post by DarkTonic Dev on Apr 17, 2020 15:20:00 GMT
So what looks like is happening is that you can't adjust the Max Distance to less than the Min Distance, which is 10 on your Audio source. I know the slider doesn't tell you that. I think that modifying the min distance on a slider for Max Distance automatically would not be good, so what do you advise we should do about this?
1) Display the tooltip showing the Min Distance and saying you can't go below that? 2) Or add a checkbox to allow modifying the Min Distance if you go below it?
Thanks for the clarification. I found the Max distance from the Audio sources 3D sound settings. I adjusted the trigger sizes from there. I removed the Ambient sound script from the game object and added it back and now the Max distance is smaller.
I'm not quite sure which option would be better. Maybe improve the Master Audio documentation to tell user what to do and use the tooltip to point user to the right documentation.
I noticed that Audio source has two triggers. Modifying the larger trigger changes the Max Distance value but modifying the smaller does not seem to change any value on the Inspector. What is that smaller trigger used for? Is it referencing the key on the 3D sound settings (see image) or something else?
Post by DarkTonic Dev on Apr 18, 2020 17:57:55 GMT
Not sure what you mean by triggers. Max distance is what is used to determine whether the sound in audible or not by Ambient Sound. Everything else determines how loud it is by the Unity audio engine based on how far away it is from the Audio Listener. it's called the rolloff curve and can have any number of points on that graph. You can add more.
You can read about that on the Unity documentation.
The Min/Max sliders are available when the Audio Group is assigned to the Master Audio Object. The reason I could not see it was that I have my sound group dynamically assigned at runtime with DynamicSoundGroupCreator. This explains why I see the sliders in runtime only.
Can you think of any way around this? Also, is there a Gizmo for the Ambient Sound object to show where the sound source is in runtime?
Ok, that's fine. I can just add a prefab of the Master Audio component to my scene and have it destroyed in runtime.
You mind helping me trouble shoot the Ambient Sound component in my scene? I haven't been able to get it to work yet since reinstalling MA. I have an Ambient Sound component with two Mesh Colliders as children. These run along the shoreline.
But when I enter the scene the Shoreline audio basically snaps to my player's loctaion.
Physics.ClosestPoint can only be used with a BoxCollider, SphereCollider, CapsuleCollider and a convex MeshCollider. UnityEngine.Collider:ClosestPoint (UnityEngine.Vector3) TransformFollower:RecalcClosestColliderPosition (bool) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/TransformFollower.cs:311) DarkTonic.MasterAudio.MasterAudio:RecalcClosestColliderPositions () (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:1361) DarkTonic.MasterAudio.MasterAudio:ManualUpdate () (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:1260) DarkTonic.MasterAudio.MasterAudio:LateUpdate () (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:1247)