making a healthbar?

I have searched about, and I cannot find anything that works right when I copy and paste the code into my game.

I would like to show a healthbar and a ammo bar on my screen, one above the other, like this:


(top = health
bottom = ammo)

Please can you show me how to do it??

thanks!

	// - Calculate fraction of how much health we have left (0...1)
	var healthFraction = Mathf.Clamp01(hitPoints / maximumHitPoints);

	// - Adjust maximum pixel inset based on it
	healthGUI.pixelInset.xMax = healthGUI.pixelInset.xMin + healthGUIWidth * healthFraction;

From the FPS Tutorial (part 3).

ok, thanks!

regards,
Michael

edit- you have helped me a few times now!

I try my best.

And you do good each time.