- Home /
 
 
               Question by 
               logang · Mar 21, 2013 at 08:29 PM · 
                audiosoundplaynotworking  
              
 
              Audio not playing!
Here is the code:
 var Cool = false;
 var CanHit = true;
 private var AtBase = false;
 private var hits = 0;
 var die : AudioClip;
 var helth = 20;
 
 
 var Bullet : Transform;
 
 function Update () {
 
     if(AtBase == false) {
     
         transform.Translate(0, 0, .04);
     }
 
 }
 function OnTriggerEnter( other : Collider) {
     if(CanHit == true) {
     if(hits == helth) {
         CanHit = false;    
         print("I AM DEAD");
         audio.clip = die;
         audio.Play();
         yield WaitForSeconds(3);
         Destroy(gameObject);
     }
     }
     if(CanHit == true) {
     print("Hit");
     hits += 1;
     }
 }
 
               The Audio was playing just fine then it was not working and i got a error when i built the game dont know if that has to do with some thing
               Comment
              
 
               
              That is the thing i dont know :/ when i got it a clicked play to see if something got messed up and i had clear on play so i did not get the time to look at it. i should have look before clicking play. Lol
Your answer
 
             Follow this Question
Related Questions
Can't get my sound to work.. 1 Answer
Best way to play audio sound effects 1 Answer
Audio Playing upon death 1 Answer
Background Music 2 Answers