Playback of the sound of firing at a distance

Hello!

Faced with this problem.
I am trying to implement a tank shot.
I have 3 types of shot samples (close range, medium and long range).
I have an event which contains these 3 samples.
I need the samples to be played depending on the distance (for example on distance of 1km the sample “far distance” will be played.
The thing is that I make RTS game and the camera is mostly high above the terrain.
How do I do it?
And is there such a possibility using one event?

With respect,
Alex

Yes, by using the built-in distance parameter.

What’s the problem? Do you want the height of the camera to be taken into account or not?

Hello, thanks for the quick reply! I’ve already sorted it out.
I created a parameter “continious” from 0 to 2 and specified the required distance to enable the sample in the automation of this parameter

I wanted to play the sample that I wanted (namely the sound of the shot at a long distance). I also set up all the necessary automation in the distance parameter (volume, lowpass, etc.).
Seems to be working stable for now.

Why do you put your instruments in the “Size_Shooting” parameter sheet, with this parameter automated by the built-in Distance parameter, instead of putting directly your instruments in the Distance parameter sheet? Check the explosion event in the exemples provided with FMOD Studio to see what I’m talking about.

Yes, I’ve tried putting the samples in “distance”, but when I fly the camera around the scene in unity, the samples play constantly. I’ve only recently started working in FMOD, maybe there’s a feature that turns this off.

To avoid multiple triggering, you probably just have to check “hold value during playback” on the “distance” parameter.


By the way, I don’t really get how did you avoid the problem by automating one parameter by another…

yes by the way I didn’t check that value, I’ll try it now.

Yes what you advised me works. thank you very much!
If you don’t mind me asking one more question.
For some reason it’s starting to work like this now… If I quickly change the value of the distance parameter (roughly speaking, quickly approaching a unit with the camera, then this origneous point moves very smoothly with a delay, before this did not happen).
I.e. I am at an altitude of 500m, then quickly move the camera to the object, then a very slow sound increases.

You probably set a seek speed you don’t want, on the parameter: image

YES its work.
thx , big thanks :wink:

1 Like

If you put the 3 distance shots on 3 tracks on the Timeline, you can trigger them in sync, and automate the volume of each track by distance. That way you can blend between the distances smoothly so that you get a nice result at any distance without sudden changes in sound.