how do fly by sounds even work? just a boxcontainer along the raycast line, check for players, and play that sound to them at a certain time?
Pretty much what Conan said (Thanks btw Conan, I looked at your code as a reference)
1. Determines your closest point to the vector of that raycast, and then calculates the distance between your position and the closest point
2. If you're within the fly-by sound radius it will then check to make sure that the closest point on the vector is actually within the space of the raycast (so you're not hearing fly by sounds for a bullet that is yet to pass)
3. Compares the angle between the vector between the start point of the raycast and the player position, and the vector of the bullet, and if the angle is less than 90 we can assume that the bullet is coming towards you and not away from you
4. Calls the play3D method on the client object with the chosen fly-by sound and the closest point along the vector as the position
Originally I was doing some spaghetti bullstuff radius search stuff that made loud or quiet sounds or none at all depending on how far away you were from the middle of the raycast, you can actually look at my DMR weapon if you want to see lmfao