this is my Health Bar script wondering if someone can go over it and PM me it with your mods so it works i keep getting a few errors over and over PLEASE help me
For starters, when posting code try if you can to post them within the [ code ] tags for easier reading and formatting. As for the errors with your script, it simply states that the rect type could not be found, that is because in C# the naming is case sensitive and the correct type name would be Rect in the GUI.Box. Aside from that all functions as intended within the script.
Update#
Okay so i fixed it… but still getting the "not complaited or something error
[COLOR="blue"]
using UnityEngine;
using System.Collections;
public class PlayerHealth : MonoBehaviour {
public int maxHealth = 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);
}
}[/COLOR]
[COLOR="darkgreen"]
[END CODE][/COLOR]
Quick jot off, then an answer to the error you’re encountering. It would be quite a bit more helpful to know the exact message from the compiler instead of an “…or something error” Now for your issue, there is no class member of curHealth so if you were to add a declaration to something similar to the following private int curHealth = 100;, it would compile without error. The console is an invaluable tool, it will tell you the exact compile error, and even the line that it is encountered on; which is usually enough information to solve the problem.
EDIT : Seems as though FizixMan beat me to the point while I was typing this out.
insulting someone to be a “little mapper” will make you look even more of a noob.
i saw nothing from you till now. You just asked for freebees, you are not interessted in learning anything, you just want stuff made for you and you spam the whole forum. You don’t even managed to post with code-tags!!!