Voice input mechanics
Last updated
Was this helpful?
Last updated
Was this helpful?
Previously I ported over the function that allowed us to get the user their voice volume and several mechanics that made use of that volume. Now I adjusted the rotation mechanic and added support for a flame that gets bigger/smaller depending on voice volume.
I wanted to create a particle effect that looked like fire and manipulate the size of the fire with the user their voice.
The second step was manipulating several particleSystem values through a script. I wanted to modify the emissionRate so more/less particles were created. ParticleScale so the particles would be bigger with a louder voice and particleLifeTime so that the bigger particles would also be alive longer which would mean that they reached a higher altitude.
Testing what the fire looked like was quite a hassle, because I had to put on my headset, make noises into my mic, then take off my headset and then modify some values. So to make that a bit easier for myself I implemented a debug value that I can modify in the inspector that simulates an input value.
We already had a voice input rotation, but it was implemented quite weird which caused the object with the script to reset their rotation to their original rotation after a short while. Which looked quite snappy and weird. So I quickly made a script for it that worked. Of course I just reused my debugging lines for this.
My first step was to create a fire particle effect. I downloaded a pre-existing one () and slightly modified some values.