to draw a health bar

Hi everybody!
I’m now engaged in creating the health management of my game using playMaker (I use it for so many other things… awesome wonderful tool!).
Let’s make it simple. Say the health of Player depends on remaining energy. Energy lower as much as the time passes by. Say with playMaker I store two float values in two global variables (timeAtEnergyRecharged and runningTime). How can I draw a rect (filled of color) on top of a GUI element that I show on screen? What would you suggest to compute a health state and to show it in % on the GUI just using that rect? Thank you mates…

There’s a three part series on MasterGamecraft.com that you might find useful for this:

How to Create a Player Health Status Indicator for the Unity GUI, Part 1

How to Create a Player Health Status Indicator for the Unity GUI, Part 2

How to Create a Player Health Status Indicator for the Unity GUI, Part 3

You could adjust pixelInset.width of another GUIElement placed on top of the first.