Search Unity

how to display objective or HUD

Discussion in 'Scripting' started by 3, Sep 17, 2012.

  1. 3

    3

    Joined:
    Sep 16, 2012
    Posts:
    387
    Like what script and how would I import an image to display health? An example would be great. Thanks.
     
  2. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,699
    Like yah man. Do it like this. Like take an object, slap on a texture, drag that object onto your camera, so it is a child. Now you got a HUD. As for coding. You should learn the basics dude.myou could actually shrink the object or change the frame of an animation. You could swap textures, (kinda like an animation) or you could adjust uv's on an atlas.


    Code (csharp):
    1.  
    2. function  playerGotHit()
    3. {
    4. playerHealth = playerHealth - damageAmount;
    5. ///now adjust your HUD accordingly
    6. }
    7.  
     
  3. 3

    3

    Joined:
    Sep 16, 2012
    Posts:
    387
    Like thank you for like the prompt response