is it possible to make it so that a Swoosh sound plays when you pass a tree at a certain velocity? if so how would i go about doing it
ps. the tree is the default ones generated by the terrain
is it possible to make it so that a Swoosh sound plays when you pass a tree at a certain velocity? if so how would i go about doing it
ps. the tree is the default ones generated by the terrain
You would most likely use a proximity trigger or Collider attached to a game object that has a audio source component attached.
This is a pretty good post about using Triggers. It may point you in the right direction at least.
http://technology.blurst.com/unity-physics-trigger-collider-examples/
and this one:
I actually implemented this for my helicopter game.. the effect is that when you fly past buildings, you hear a "swoosh".
Thing is.. there's really no "swoosh" sound - what really happens is that you are hearing the reflection of your own sound, for example engines, wheels, rotors, wind friction and so on.
What I did was to raycast short distances in a lot of directions around the vehicle, and move an audio source toward an average of points that were hit, and raise the volume of the audio source based on number of hits etc. This creates the illusion that the sounds are being reflected off a nearby object or surface, which creates a very good and dynamic "feeling of speed".
Should work like a charm in racing games and similar scenarios.
Edit: By the way - if using this approach you will want to slightly smooth out the repositioning of the audio source, or it will sound weird when the audio source changes position instantly.