Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make realistic speed of sound system with accurate calculations?

Asked by 3 years ago
Edited 3 years ago

Hello, I am currently making an FPS game with ACS, and I wish to know how to make a realistic speed of sound system for gunshots and explosions.

Basically, calculate the distance between the source of the sound and the player, this would mean some sort of Client to Server event but I do not have much knowledge about them.

A good example of this system is seen in ArmA 3 or Squad, both of which have some astonishing realism when it comes to accuracy with sounds, including speed of sound. Here's a good example of what I mean:

https://youtu.be/KWyuMpv5VV8?t=35

If anyone could give me a full out tutorial on how to do this, please answer to this or DM me in my Discord: krypto#6969 < Expect it to change since my Nitro subscription will be cancelled at the 29th.

Thank you.

Edit: Forgot about this part which is even more accurate and explains what I mean more clearly. https://youtu.be/KWyuMpv5VV8?t=28

1 answer

Log in to vote
0
Answered by
LaysCo 61
3 years ago
Edited 3 years ago

You would use sound properties such as

sound.EmitterSize
sound.MaxDistance
sound.Volume

When say the bomb explode you would subtract a decrease in these for example

sound.EmitterSize = sound.EmitterSize - 1
sound.MaxDistance = sound.MaxDistance - 1
sound.Volume = sound.Volume -1

or you could Add to these

sound.EmitterSize = sound.EmitterSize + 1
sound.MaxDistance = sound.MaxDistance +1
sound.Volume = sound.Volume +1

To do so similar You could use SoundService But never give up work on the coding until its how you like adjust rollofscales etc. game:GetService("SoundService")

0
By this I meant accurate calculations using actual math. And, by speed of sound I meant some sort of delay according to the distance between the source of the sound and the receptor. Cryptographz 0 — 3y
0
your best bet is to use magnitude LaysCo 61 — 3y
Ad

Answer this question