- Home /
Keep getting unexpected char: 0x200B!
I downloaded a hunger and health script. I saved it as a javascript and I haven't tampered with it or anything yet. I keep getting this error
(26,25): BCE0044: unexpected char: 0x200B.
Can someone please help me with this? Here's the script
 var Health : int = 100;
 var MaxHealth : int = 100;
 var Hunger : int = 100;
 var Timer : float;
 var Texture1 : Texture2D;
 var Texture2 : Texture2D;
 var BarLength : int = 100;
 
 private var Speed : int = 3;
 
 function Update () {
     Health = Mathf.Clamp(Health, 0, MaxHealth);
 
     if(Health > 0){
         Timer += Time.deltaTime;
         
         if(Timer >= Speed) {
             if(Hunger >= 85) {
                 Health += 3;
             }
             if(Hunger <= 0){
                 Health -= 1;
                 Speed = 1;
             }
             else {
                    Hunger -= 1;
                 Speed = 3;
             }
             
             Timer = 0;
         }
     }
 }
 
 function OnGUI () {
     GUI.DrawTexture(Rect(400,400,100*Hunger/BarLength,20),Texture1);
     GUI.DrawTexture(Rect(400,430,100*Health/BarLength,20),Texture2);
 }
Answer by SubatomicHero · Jun 12, 2013 at 02:01 PM
Weird thing, but when I copied and pasted this into notepad++, on line 26 where you have Hunger -=1; there was a question mark (?) on that same line even though you cant see it here in the post.
Maybe creating a new script and typing it out line for line would probably help clear out any anomalies. It seems you may have some white space issues/garbage which can happen.
Your answer
 
 
             Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Pause Menu background problem 0 Answers
Can't draw a box using Basic GUI 1 Answer
Material on GUI Transparent problem 0 Answers
Problem with SSL CA cert 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                