Making an HUD

I just started unity a few days ago- the only thing im good at is making Terrain, and i wanted to add health and hits, i cant find a single website that will explain to me Exactly how to make health or put and HUD on the screen. If you want to say, I want to add a COD HUD- it shows ammo and stuff like that, i dont even know how to make bullets with damage- so if any one can lead me to another question or completly walk me through this that would be great.

Ps. also im making guns im probly going to put on a website later, if i do/ and learn how to make bullets and damage, they should be snipers and shotgunz,
anyways ThankYou!
For Your Help!

Check the GUI functionality. That is precisely what you are looking for.

http://unity3d.com/support/documentation/Components/GUI%20Scripting%20Guide.html

&

http://unity3d.com/support/documentation/ScriptReference/30_search.html?q=GUI

Wow, that’s a lot to take in. You should slow down. First of all, no one is going to take you through that whole process. You have to learn it yourself. You should go step by step. First, learn Unity. Go to the Unity Manual to learn the basics of Unity. Then go to Unity3D Student. It will go into some of the same topics, but also goes into deeper stuff. There are a lot of tutorials on HUD, but you should start learning GUI, which is basically the same thing. After you do that, you will be prepared to start creating your game. (Believe me, it works.) If you have any further questions after that, then come to Unity Answers. Try to learn before you ask. Also, look at other questions before you ask because they might ask the same thing. Look at How to make a GUI or HUD. Also look at this.

Hope this helps & good luck on Game Design :slight_smile:

Alright.
First of all, i am not an expert. i have learned from experience like everyone else. so if something is conflicting, you should probably use the other source.
Second, i know this was posted in 2011. but maybe this response will help someone else.
Third, this code is kind of sketchy. it may not work quite right. it will take some work to get it up and running.
but. here is my code.

  void OnGUI()
    {
       
            GUILayout.Label("Ammo = " + projectile1ammo);
            GUILayout.Label("Cartridges = " + projectile1cart);
            GUILayout.Label("reload time left = " + projectile1rel);
       
    }

the “void OnGUI(){” MUST come before all GUI actions. it also cannot go inside another void.
The GUILayout.Label will always come out in the upper left hand corner. i don’t know why, it just will. the " + projectile1ammo" references a Interger. it simply puts in a number. the ("ammo = ") or whatever else happens to be there is what will be displayed.

So, that’s what i know. it’s probably very flawed, i’m no expert. if you have any other problems, just leave a reply. i will try to help.

~regards, Rocketman.