|
Hey, I'm trying to make a telephone ring, and when you get close to it, the ringing stops and another audio plays. I can't seem to get the audio to stop and the other audio to play like when I touch it or something else. I tried this:
and it says Assets/Scripts/collisions 1.js(21,29): BCE0019: 'Play' is not a member of 'UnityEngine.AudioClip'. Please help
(comments are locked)
|
|
Unity tells you that you are trying to play an audio clip. You can't do it like that. What you need to do is to attach the clip to an audio source, then tell the audio source to play. Im short, a clip is a file that has to be put on a audio source component on a gameobject. Then you can handle the audio. http://unity3d.com/support/documentation/Manual/Sound.html explains the terms in more depth. I did attach it to an audio source. Here is what Ive got; two audio sources on one object; The first audio source is a play when awake, to play ringing. The second audio source is not on awake, I want that to play when I touch the gameObject.
Apr 09 '10 at 01:28 AM
DTJ Productions
(comments are locked)
|
|
Take a look at this question which explains the different methods of playing audio. Thanx I read that, but sorry that didn't solve my entire issue. It helped though.
Apr 08 '10 at 02:13 AM
DTJ Productions
(comments are locked)
|
