Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 /
avatar image
0
Question by risinghell09 · Jun 12, 2013 at 01:57 PM · guierrorchar

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);
 }
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

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.

Comment
Add comment · Share
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

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

15 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

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges