Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Labyrinth · Jan 23, 2013 at 09:58 PM · shaderbarhealth barhealth

Far Cry 3 Health Bar System

Hey everyone. I was watching a play through of Far Cry 3 and I noticed that the health bar system is designed on a curve but instead of just removing or adding a bar when health is lost/gained, that bar of health actually scales, but on the same curve. I know how you could do this horizontally or vertically because that is one direction but I am puzzled as to where I would begin with something like this. My friend had mentioned using a transparent cutout shader but I would like more insight if possible. Much thanks and any help is appreciated.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by iwaldrop · Jan 23, 2013 at 10:20 PM

http://lmgtfy.com/?q=unity+circular+health+bar+howto

http://answers.unity3d.com/questions/14770/creating-a-circular-progressbar-timer.html

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Labyrinth · Jan 24, 2013 at 04:45 PM 0
Share

Thank you.

avatar image
0

Answer by sparkzbarca · Jan 23, 2013 at 10:25 PM

essentially you make a full health bar (which in this case happens to be curved) in your preferred image editing software.

http://www.youtube.com/watch?v=dpXJrgRJRQI

this shows you how to do a simple one, but one which is oddly shaped.

if your wondering well what about those little splits, you can do it one of two ways you can make each bar its own health bar and scale each one individually. (just make an array of small bars. To subtract you subtract from the top bar to start, when the amount visible is zero you move to the next bar in the array and call subtract on that, likewise its the opposite for adding hp).

The other option is to make the entire health bar one image.

Then what you do is make the gaps between each bar have the same color in the alpha transparency. what you can think of it as is.

the first bar is from 100% white to 80% white. the gap in between has no range, it is 80% white. now when you get to 80% and you go down to 79% you will not subtract a tiny insignifigant amount, but a large amount, you'll subtract the entire gap plus a tiny amount off the second bar.

basically you'll do the gradient thing but you'll gradient not from 100% to 0 over the whole image but from 100% to 80% over the first healthbar and then from 80% to 80% on the gap below it, then from 80% to 60% over the second healthbar and 60% to 60% over the gap below it etc.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Labyrinth · Jan 24, 2013 at 04:45 PM 0
Share

Thank you very much for the insight. I hadn't thought about it that way. The video for making a custom health bar was a helpful touch too :). $$anonymous$$uch appreciated.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Health bar with partial hiding 0 Answers

Health Bar decreases in both directions 0 Answers

Enemy Health Bar 1 Answer

Can someone write me a health script? 2 1 Answer

Lerp sets value instantly, not interpolating it? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges