Table of Contents
-
Lessons
The magic spells, smoke, and flame graphical effects are using Unity’s Particle System to render nice and fluid graphics. As such, the waterdrops in the cave have also been designed using a particle system. Every particle emitted falls with increasing speed towards the floor due to gravity. On collision with the floor, it triggers a function inside the Cave_WaterDropSounds Unity script attached to the same object. The waterdrop particle system emits 10 waterdrops per second, but as each of them posts an Event on collision with the floor, it could easily take up a lot of performance for a nice-to-have feature. Let’s limit the number of voices that can play at once.
-
From the Layouts menu, select Designer.
-
In the Project Explorer, expand Actor-Mixer Hierarchy > Default Work Unit > World > Ambient > Ambiences > Ambiences_Emitters > Emitters and select the Ambient_Water_Waterdrops Random Container.
-
In the Advanced Settings tab’s Playback Limit group box, enable Ignore Parent.
This will prevent it from being limited by parent container limits.
-
Enable Limit the sound instances to.
-
In the ‘Limit the sound instances to’ field, set it to 1 and change the list to Globally.
You can now decide what to do with the voices that’ll be removed in the ‘When limit is reached’ list. As it’s a fairly short waterdrop sound, let’s keep it as Kill Voice (the default option) to minimize resource usage.