i made this health script in c# and i always get the same error i tcheck my code like 100 time and i cant find my error plz help me.
code:
using UnityEngine;
using System.Collections;
public class PlayerHealth : 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.with / 2 /(maxHealth / curHealth), 20), curHealth + "/" + maxHealth);
}
}
what is the error you are experiencing?
– anon55654435Please reformat your code... select it, and click the 1010 button
– AVividLightthanks for the kind words, im kinda proud of this one lol....also i googled up a bit and found that to create and save a new scriptable object at runtime will not be worth the trouble so i guess im going for the manual creation way now...also...do you know what's the download size of the unity editor without anything else....i updated unity hub today and it uninstalled the current editor for no reason...and i have limited internet....plus unity hub is totally opaque about the size of the editor so i guess i'll need to do some management and planning for this simple task
– rage_coagain, thanks for the support you've provided on this problem...im really grateful
– rage_co