Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Sign in to follow this  
geckoo

health script with old GUI

Recommended Posts

Often I use this script so as to create a little health code using the old GUI which is not bad. Of course, it's could be better to use Canvas, but it's a good stuff. It displays a thin line with colors according screen resolution - like in my game Please login or register to see this link. (and others). It creates a few textures at start. Also I implemented a couroutine to decrease progressively health and another one if player recover his health (bonus function). You have to call the damage function setting a value and you will see health line decreasing green to red. Only put this script on an object - no more. You can use this script as a timer too - it's the same logical process. I did that so as to answer to a question on our forum. I hope that it will be useful someone ++

 

Please login or register to see this code.

Share this post


Link to post
Share on other sites

Test it adding this code :

 

Please login or register to see this code.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...