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.

  • 0
Sign in to follow this  
joshglen

Add healthbar in fps kit?

Question

6 answers to this question

Recommended Posts

  • 0

You can simply use two textures to create a bar - like in this example (adjust position) ++

Please login or register to see this code.

Share this post


Link to post
Share on other sites

  • 0

I posted a very optimized version here about stamina bar Please login or register to see this link.

The principle is the same.

 

The OnGUI() should contain as less calculations as possible.

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

Then just use the enemies stats? Same thing

Share this post


Link to post
Share on other sites
  • 0

There are two options to achieve this.

  • The bar is rendered using GUI, which is an 3d space illusion. You will have to write a stack which basically represents the depth order, which of them should be rendered in what order.
    Please login or register to see this link.
  • Bar is actual 3d object floating on top of the players head always looking on actual player, scaling might and optimization be a bit problematic, as well as it will be harder to keep it organize in single structure. Still solutions tends to look simpler than first one, and will not require basic programming.

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
Answer this question...

×   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...