Health Text via GUI

Hello,

I just got my enemy’s health value to decrease when it is attacked by the player. I can get it to display and decrease with the following code:

print(enemyHealth);

However, when I build and run the game, I can no longer see the health value and I was hoping that this could be accomplished through GUI. I am not all that familiar with GUI, but I tried some basic stuff (that didn’t work) like the following:

function OnGUI()
{
GUI.Box(Rect(10,10,100,90), enemyHealth);
}

Didn’t work, so I figured I’d try here before I call it an evening. Thank you for your time and I’ll post up here when I figure it out if nothing comes of posting it here.

Use a label instead. GUI.Label();

Thank you. I will give it a try this evening and hopefully it works out well. I appreciate it.

This worked very well, thank you.

Can u post ur script here plz or message it to me