- Home /
How do you to reverse reverb zones?
I haven't seen anyone answer this, but I'm trying to make a gun shot in the distance sound far away and echoey. From what I know, reverb zones only applies maximum reverb within min distance, not the other way around.
How do you reverse the reverb zone so that there's no reverb within min distance, but maximum reverb applied beyond max distance?
Answer by dan_wipf · Nov 13, 2018 at 10:41 PM
well you could use the Audio Reverb Filter and calc. the distance from the Gunshot. Based on the Distance, you increase the Room Property.(Like Dry/Wet property of AudioEngenering Tools) .
I imagine something like this:
using UnityEngine;
public class AudioDistanceReverb : MonoBehaviour {
public AudioListener target;
public float MaxDistance;
AudioReverbFilter ARF;
void Start () {
target = GameObject.FindObjectOfType<AudioListener>();
ARF = GetComponent<AudioReverbFilter>();
}
void Update () {
float dist = Vector3.Distance(target.transform.position,transform.position);
if(MaxDistance < dist){
ARF.room = 0;
}
if(MaxDistance > dist)
ARF.room = Mathf.Lerp(-10000,0, (dist / MaxDistance));
}
}
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
transitioning from a dry zone to reverb zone 1 Answer
Reverb zone depending on audio source location not listener 0 Answers
Over lapping reverb zones 0 Answers
How do Audio reverb zones work, how are they set up? 0 Answers