i have this exp bar it it attached to a gui texture. it workes fine until the player levels up because the maxexp changes . can anyone show me how i can make the maxexp into the guis 100%
so what ever maxexp is it is 100%
function Update ()
{ var number = Pointslevels.exp; var posx= transform.position.x; var posy= transform.position.y; guiTexture.pixelInset = Rect (posx, posy, number, 9);
}
this is attached to the gui
static var level:float = 0;
static var exp:float = 0; static var maxexp:float = 50; static var expde:float = 0;
function Update () { if(exp>=maxexp){
level +=1;
expde +=10;
maxexp +=10;
exp =0;
//exp =0;
}
}
this is like other stuff that has the maxexp and the current exp