- Home /
 
 
               Question by 
               Coolishy777 · Apr 03, 2015 at 12:25 AM · 
                audioaudiosourceplay  
              
 
              Audio.Play() not showing up
I am currently working through the space shooter tutorial on the unity website and have gotten to the audio portion of the guide. I am using unity 5 and the MonoDevelop does not have Audio.Play(), nor does it have AudioSource.Play(). How do I have the script play a sound that is in the audio source of the player game object?
               Comment
              
 
               
              Answer by HD32 · May 05, 2015 at 06:16 PM
You probably didn't set up the scrip correctly, try this:
 @script RequireComponent(AudioSource)
 public var otherClip: AudioClip;
  
 function Update () {
     if (Input.GetButtonDown("Fire1")) {
         audio.Play();
     }
  }
 
              Your answer
 
             Follow this Question
Related Questions
Audio continuation through two scenes 3 Answers
Playing Sound 2 Answers
Audio clip not playing 1 Answer
Active audiosource change on button press. Making a ingame radio. 1 Answer
Audio playing problem 1 Answer