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 /
This question was closed Jun 20, 2014 at 10:01 AM by meat5000 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Nessebr · Oct 25, 2011 at 01:34 AM · cs8025cs1525cs1519

PLEASE HELP!!!! using BergZurgArcades guide having error!

im using BergZurgArcade's guide and there are three errors coming up. im a newb so please help!

1) CS1525: Unexpected symbol ':', expecting ')' or ','

2) CS1519: Unexpected symbol '' in class, struct, or interface member declaration

3) CS8025: Parsing Error

Please help me! would be much appreciated. Just what I need to change thanks! heres the script:

 using UnityEngine;
 using System.Collections;
 
 public class PlayerHealth : MonoBehaviour {
     public int maxHealth = 100;
     public int curHealth = 200;
     
     // Use this for initialization
     void Start () {
     
     }
     
     // Update is called once per frame
     void Update () {
     
     }    
         
     void OnGUI () {
     GUI.Box (new Rect(10, 10, Screen.width / 2 / (maxHealth / curHealth), curHealth + "/" + maxHealth);
     
     }


Please Help!!!!

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

5 Replies

  • Sort: 
avatar image
0
Best Answer

Answer by syclamoth · Oct 24, 2011 at 11:49 PM

You didn't do something silly, like put all of that in a .js file, did you? It's C#, it needs to be in a file ending with .cs, not .js. Other than that, I can see that you are missing a curly bracket at the end, but that might just be a copy-paste error.

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
avatar image
0

Answer by roamcel · Oct 25, 2011 at 07:40 AM

All of burgzergarcade's scripts are in c# if I remember correctly, so be sure to create a c# script and name it exactly as the class, PlayerHealth in this case.

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
avatar image
0

Answer by magicbananna · Mar 18, 2012 at 04:56 AM

you are missing a ) at the end of you gui line so it reads the code wrong easy fix

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
avatar image
0

Answer by magicbananna · Mar 18, 2012 at 04:39 AM

GUI.Box (new Rect(10, 10, Screen.width / 2 / (maxHealth / curHealth), curHealth + "/" + maxHealth);

ok easy fix. look at the Parentheses you have three left and only 2 right so it reads the code wrong put one more in at the end it should work

GUI.Box (new Rect(10, 10, Screen.width / 2 / (maxHealth / curHealth), curHealth + "/" + maxHealth)); ------ like this-----

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
avatar image
0

Answer by Rillorn · Oct 29, 2012 at 03:16 PM

YOUR MISSING A } AT THE END!!!!!!!!!!!!!!!!!!!!!!!!!!

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

Follow this Question

Answers Answers and Comments

6 People are following this question.

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

Related Questions

5 Errors, Need help, Unexpected symbol private etc 0 Answers

Unable To Find Solution For Errors 1 Answer

If CODE problems.. 1 Answer

Errors CS1525 and CS8025.... 1 Answer

Script Errors with C# 1 Answer


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