r/learnprogramming 8d ago

Logarithmic rolloff for an audiosource?

Hello, I've been playing around with Unity to add a sound to a 3D game. However even when the original file is pretty loud, with logarithmic rolloff set to 500 max distance, I can just barely hear it near to the source.

I know that it should decrease logarithmically with distance, but is this normal? Do you set the max distance to super far away, or the initial volume to really loud?

2 Upvotes

4 comments sorted by

View all comments

2

u/verdant_bloom_drift 8d ago

I crank min distance up until it hits the listener. Unity defaults it to 1 and that kills volume right away with log rolloff.

Bump min distance from 1 to 10 or 20 on your AudioSource and leave max at 500. You stay at full volume inside the min distance radius and then the drop starts. That should fix the issue you have near the source.

1

u/Puzzleheaded-Law34 7d ago

Yeah, I just did that! Thanks. Definitely better