- Home /
character in Reverb Zone?
I only want a sound to make sounds when I'm in a reverb zone. so I need some code to return true when I'm in a reverb zone:
while ??(transform is within a reverb zone)??
{
if (controller.isGrounded && controller.velocity.magnitude > 0.3 )
{
audio.clip = walkSounds[Random.Range(0, walkSounds.length)];
audio.Play();
yield WaitForSeconds(audioStepLength);
}
else
{
yield;
}
}
Comment
Best Answer
Answer by Jessy · Mar 12, 2011 at 09:31 PM
// I recommend you store these in the Editor if they won't change. var reverbZone : AudioReverbZone; var reverbPosition = reverbZone.transform.position; var reverbSquareMagnitude = reverbZone.maxDistance * reverbZone.maxDistance;
var inReverbZone = (transform.position - reverbPosition).sqrMagnitude < reverbSquareMagnitude;
Your answer
Follow this Question
Related Questions
Change reverb zone gradient to linear 0 Answers
Buggy Reverb Zones (Reverb with No Dry) 1 Answer
Reverb? Reverb Zones?!?!? 2 Answers
Distribute terrain in zones 3 Answers
How do Audio reverb zones work, how are they set up? 0 Answers