• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Feb 15, 2014 at 04:00 PM by robertbu for the following reason:

Duplicate Question

avatar image
-1
Question by Ngoadam123 · Feb 15, 2014 at 03:59 PM · errorfix

Fix this script?

I saw this script and I tried it out but it doesnt work because of the following error

Assets/Scripts/Hunger.js(26,25): BCE0044: unexpected char: 0x200B.

Could someone perhaps fix it.

 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);
 }
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image robertbu · Feb 15, 2014 at 04:00 PM 0
Share

When you find a error you don't know, Google the error message. Hint: the problem is on line 26.

0 Replies

  • Sort: 

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

4 Error on my script. 1 Answer

How to check collision with specific object 1 Answer

NullReferenceException Error 2 Answers

Send an activity from C# to Java 0 Answers

When I try to copy and paste something to my script... I get an error. 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges