# FMOD Unity destroying instances based on distance

**URL:** https://qa.fmod.com/t/fmod-unity-destroying-instances-based-on-distance/20219
**Category:** Unity
**Tags:** csharp, unity
**Created:** [May 15, 2023, 9:17pm UTC](https://qa.fmod.com/t/fmod-unity-destroying-instances-based-on-distance/20219 "2023-05-15T21:17:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![JohnGreska](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@JohnGreska](https://qa.fmod.com/u/JohnGreska)
#### Post date: [May 15, 2023, 9:17pm UTC](https://qa.fmod.com/t/fmod-unity-destroying-instances-based-on-distance/20219/1 "2023-05-15T21:17:48Z")

</div>

Hello!

I’m working on a project with a village, all of which are equipped with a dryer. And each dryer makes a looping dryer noise. But if there’s 10 houses and 10 dryers, and they’re all spread apart, I don’t want all 10 to be instanced/referenced in the CPU (is that the term for it?). I only want the one I’m within earshot of to be in the CPU so as to optimize the game, so there’s only 1 sound playing at once and not 10 sounds playing even though I can’t hear the other 9. Is there a method to do this?

---

<div class="post-metadata">

### Author: ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)
#### Post date: [May 16, 2023, 4:05am UTC](https://qa.fmod.com/t/fmod-unity-destroying-instances-based-on-distance/20219/2 "2023-05-16T04:05:06Z")

</div>

The FMOD Engine takes care of this automatically using our [virtual voice system](https://www.fmod.com/docs/2.02/api/white-papers-virtual-voices.html): Any event instance so far away from the listener that the player can’t hear it is automatically “virtualized.” While virtualized, an event instance consumes only a tiny fraction of CPU time. A virtualizeed event instance that comes back into audible range automatically becomes non-virtual (and thus resumes consuming CPU time) again.

---

<div class="post-metadata">

### Author: ![JohnGreska](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@JohnGreska](https://qa.fmod.com/u/JohnGreska)
#### Post date: [May 17, 2023, 12:18am UTC](https://qa.fmod.com/t/fmod-unity-destroying-instances-based-on-distance/20219/3 "2023-05-17T00:18:12Z")

</div>

Understood. Thank you!
