|
Hey, I need to stop an audio when another audio turns on, im trying to make ringing and when I touch the phone the ringing stops, how do I do that? Heres part of my script function OnControllerColliderHit(hit : ControllerColliderHit) { if(hit.collider.gameObject.tag == "hippo") { hit.collider.audio.clip = myAudioFile; hit.collider.audio.Play(); } }
(comments are locked)
|
|
http://unity3d.com/support/documentation/ScriptReference/GameObject-audio.html http://unity3d.com/support/documentation/ScriptReference/AudioSource.html http://unity3d.com/support/documentation/Components/class-AudioSource.html http://unity3d.com/support/documentation/Manual/Using%20Components.html Between these reference articles and a use of triggers/colliders, you should be able to detect when a collision happens, access the necessary Audio Source Components, and control them as needed. Thanks for these references but these don't help, I need a script.
Apr 11 '10 at 02:48 PM
DTJ Productions
in other words: Please use the documentation and stop asking people to do your work for you :p ... No really, DTJ, if you find the documentation hard to work with, please let us know how we can improve it.
Apr 14 '10 at 11:16 AM
Nicolaj Schweitz ♦♦
(comments are locked)
|

is that attached to the player or the phone?
also is the audio source form the phone?
The script is attached to the phone, it is in my collision script. Also the audio source is from the phone itself.