Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Health Bar GUI on VR ??

Discussion in 'AR/VR (XR) Discussion' started by SonEvil, Sep 10, 2015.

  1. SonEvil

    SonEvil

    Joined:
    Jul 29, 2015
    Posts:
    11
    I'm having problems with gui health bar, someone please help me !
    i used Dive SDK Android !

    My Health Script :


    Code (JavaScript):
    1. #pragma strict
    2.  
    3. var Health = 100;
    4.  
    5. function ApplyDamage (TheDamage : int)
    6. {
    7.     Health -= TheDamage;
    8.    
    9.     if(Health <= 0)
    10.     {
    11.         Dead();
    12.     }
    13. }
    14.  
    15. function Dead()
    16. {
    17.     Destroy (gameObject);
    18. }