im building a game with a lvl system. i whant, when my script add damage / health, a gui text to apear in the bottom and thats sliding up thats saying, lets say : hp +100 and damage + 5. how can i do it???
here is my level system script:
var guiTextEXP : GUIText;
var accumulatedExperiencePoints : int = 0;
var levelExpRequirements : int = 1000;
var currentLevel : int = 1;
var levelUp = false ;
function Update () {
if(accumulatedExperiencePoints >= levelExpRequirements) {
currentLevel += 1;
levelUp = true;
}
if (levelUp){
levelExpRequirements *= 1.2;
accumulatedExperiencePoints = 0;
gameObject.Find("MachineGun").GetComponent(MachineGun).damage += 1;
maximumHitPoints +=100;
hitPoints = maximumHitPoints;
levelUp = false;
}
guiTextEXP.text = accumulatedExperiencePoints+"/" + levelExpRequirements + "|" + currentLevel;
guiTextEXP.text = hitPoints+"/" + maximumHitPoints;