Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Need help with C# error "No Overload for method "Box" takes 1 argument" (http://www.go4expert.com/forums/help-c-sharp-error-overload-method-box-t27700/)

BinaryZombi 1Feb2012 11:20

Need help with C# error "No Overload for method "Box" takes 1 argument"
 
Hello i'm a newbie to C# so i was wonder if any one could help me here I'm trying to make a simple health bar/ hit point bar which ever one you want to call it but it keeps coming up with "No Overload for method 'Box; takes '1' arguments"
Heres the sample of how I've done it. Thanks
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.width / 2 / (maxHealth / curHealth), 20) + "/" + maxHealth);
    }
}



All times are GMT +5.5. The time now is 17:01.