JohnCooper
Guest
Posts: 0
|
Post by JohnCooper on Dec 17, 2021 13:30:17 GMT
When calculating if the sound should be played in IsActorTooFarAwayToPlay() in MasterAudio.cs, the range calculation is completely wrong due to using sqrMagnitude instead of magnitude.
... var maxRange = randomSource.Variation.VarAudio.maxDistance; var distanceFromListener = (ListenerTrans.position - sourceTrans.position).sqrMagnitude; if (distanceFromListener < maxRange) ...
should be changed to:
... var distanceFromListener = (ListenerTrans.position - sourceTrans.position).magnitude; ...
|
|
|
Post by DarkTonic Dev on Dec 17, 2021 15:55:08 GMT
Actually, I'm looking at the code now and it already says magnitude.
var maxRange = randomSource.Variation.VarAudio.maxDistance; var distanceFromListener = (ListenerTrans.position - sourceTrans.position).magnitude; if (distanceFromListener < maxRange) { return false; }
Does that look correct to you?
What version of Master Audio are you on?
-Brian
|
|
JohnCooper
Guest
Posts: 0
|
Post by JohnCooper on Dec 17, 2021 20:53:53 GMT
We are on the latest version. And yeah, that would fix it. It was pretty easy to notice when while using the max distance 50 audio source template, audio stopped playing at 7 meters distance instead of 50.
|
|
|
Post by DarkTonic Dev on Dec 17, 2021 21:10:03 GMT
Ah yep, that's fixed in the latest beta. The next version is a paid upgrade. But you can email me with your Invoice PDF file to get the beta if you like. support@darktonic.com and mention this thread.
-B
|
|
zaddo
New Member
Posts: 9
Posts: 9
|
Post by zaddo on Jan 3, 2022 23:33:38 GMT
I was just about to post this bug
|
|
|
Post by DarkTonic Dev on Jan 4, 2022 0:14:31 GMT
Watch / subscribe to the updates thread so you'll know when the fix is in.
-B
|
|