Answers

Health Question

0

Hello I need help with my health gui I have Everything I need for the Gui, I have it in the right place on the screen but its just Gui text. I was wondering if I could have it so I still keep the Gui text but have it decrease if the Player gets hit. Anything (scripts,Tutorials) would be really helpful. Thank you - ryan 123321

Yes it is possible. Make an int variable called health and set that to how much health you want. Then make a variable that is an empty gameobject called health text or something. then set your gui text to that variable.(Make sure all of this is in the same script BTW.) Then access the GUI text's text attribute and set it to the health variable. Then whenever your character gets hit subtract damage from your health variable. Heres an example.

sorry in the last comment it may have sounded like I was blaming you for the failure of the script but the only thing to blame was my lack of javascript skills. I am sorry if it came across that way and that was not the way I meant it. In other words Thank you for making a script and I tryed to create one but sadly it didnt work.