x


How do I set a distance for audioSource ???

Hello

How do I set a distance for audioSource ???

thx >>>

more ▼

asked Jan 04 '12 at 10:39 AM

firasdeep gravatar image

firasdeep
56 17 19 20

by set a distance do you mean that the sound should play only when sound source is within some distance?

Jan 04 '12 at 11:07 AM vatsalAtFEI
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You don't need any script to do that: in the AudioSource, select Rolloff Mode = Linear Rolloff, Max Distance = 5, Min Distance = 4.5 (or other value a little lower than the Max Distance) - this will make the sound disappear when the distance to the audio source is 5 or greater.

more ▼

answered Jan 05 '12 at 01:51 AM

aldonaletto gravatar image

aldonaletto
41.4k 16 42 197

thx very much

Jan 06 '12 at 02:49 PM firasdeep
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2086
x523
x354
x171

asked: Jan 04 '12 at 10:39 AM

Seen: 1095 times

Last Updated: Jan 06 '12 at 02:49 PM