- Home /
BCE0044 error
I need your help guyz. I have problem with this "HealthControl" script Here is the script: var Lives = 3;
 function Update ()
 {
     guiText.anchor = TextAnchor.TopRight;
     guiText.text = "Lives:" + Lives ;
         if (Lives = 0)
             {
                 Application.LoadLevel("GameOver");
             }     
 }
And here is the error:
Right now I dont now what to do. If you know how to solve this pls reply
 
                 
                screenshot_24.png 
                (25.8 kB) 
               
 
              
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by Landern · May 07, 2014 at 04:50 PM
A single equal sign is for assignment, double equal sign is comparison. Modify your if statement like:
 var Lives:int = 3;
 function Update ()
 {
     guiText.anchor = TextAnchor.TopRight;
     guiText.text = "Lives:" + Lives ;
     if (Lives == 0)
     {
       Application.LoadLevel("GameOver");
     }    
 }
Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                