Answer the question
In order to leave comments, you need to log in
Is it possible in Unity to make the global AudioSource override local?
Hello! I'm interested in this moment: there is 1 global AudioSource on which there is background sound and there are zones on the map with a limited AudioSource that only works when you get close to it, and is it possible to make the main AudioSource overlap with this local one, so that as you approach the local one, the global one would fade away smoothly, and when moving away from the local, the global also smoothly increased?
Answer the question
In order to leave comments, you need to log in
Can you control the volume? If yes, then change it depending on the distance.
If not, take a translator and see the docs: https://docs.unity3d.com/ScriptReference/AudioSour...
Linear interpolation to help: https://docs.unity3d.com/ScriptReference/Mathf.Cla...
By the way, Think right away what will happen if the player is next to two local zones.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question