- Home /
Question by
GongGeng · Mar 24, 2014 at 06:21 AM ·
script errorparsing error
Csharp script parsing error
My script keeps saying parsing error This is my script
using UnityEngine;
using System.Collections;
public class HealthBar : MonoBehaviour {
public int maxHealth = 100;
public int curHealth = 100;
// 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), 20, curHealth + "/" + maxHealth
}
}
Comment
Answer by robertbu · Mar 24, 2014 at 06:24 AM
I don't see something here that would generate a parsing error, but I do see errors on line 19. Change it to:
GUI.Box(new Rect(10, 10, Screen.width / 2 / (maxHealth / curHealth), 20), curHealth + "/" + maxHealth);
Answer by GongGeng · Mar 24, 2014 at 09:24 AM
i changed it to what you said but it still says parsing error. using UnityEngine; using System.Collections;
public class HealthBar : MonoBehaviour { public int maxHealth = 100; public int curHealth = 100;
// 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), 20, curHealth + "/" + maxHealth;
}
}
Your answer
Follow this Question
Related Questions
Need Help with Parsing 1 Answer
Parsing Error(newObjRight) 1 Answer
Fps controller script error 0 Answers
I cant open any scripts. 0 Answers
2D C# Jump Script Addforce 2 Answers