I have trouble figuring out what to put here,I originally wanted to display current/max but now i wanted to change that to only display the current in the box,I tried for a bit and had to put a placeholder where the maxhealth variable was to prevent error.
public float health = 100.0f;
public float maxHealth = 100.0f;
GUI.Box(new Rect(10, 20, healthbarLength, 20), health + "/" + "MaxHealth");
i tried this but it got an error
GUI.Box(new Rect(10, 20, healthbarLength, 20), health );
here’s the error (Assets/Weapons/Scripts/Player.cs(53,13): error CS1502: The best overloaded method match for `UnityEngine.GUI.Box(UnityEngine.Rect, string)’ has some invalid arguments