x


Audio Needs to stop

Hey I'm trying to make a phone ring, I have the phone ringing and when I touch it the voice turns on all I need to do it make the ringing stop. Please help, either by Javascript or something else.

more ▼

asked Apr 12 '10 at 10:29 PM

DTJ Productions gravatar image

DTJ Productions
57 19 20 25

please stop making so many duplicate questions.

Apr 14 '10 at 11:18 AM Nicolaj Schweitz ♦♦
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Use a trigger like this:

var Ringing : AudioClip;
var Voice : AudioClip;

function OnTriggerEnter (other : Collider) {
    audio.Play("Ringing");
    audio.Play("Voice");
}

This is Javascript. To use it, make a sphere. Then, remove the Mesh Rendering component, and change the collider to be a trigger. Then place this script on the trigger, and drag the ringing and the voice sound onto their respective positions in the Inspector. Then place the sphere so it surrounds the phone, representing the range you want your phone to have (how close/far you can be to make it go off). Hope this helps!

more ▼

answered Apr 12 '10 at 10:57 PM

e.bonneville gravatar image

e.bonneville
5.7k 100 116 165

how to stop playback of a sound ?

Apr 04 at 11:28 AM yusolaifdfer
(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:

x3460
x1029
x525

asked: Apr 12 '10 at 10:29 PM

Seen: 1093 times

Last Updated: Apr 04 at 11:28 AM