• 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 dreamevolved · Nov 26, 2012 at 01:11 AM · healthbar

How to create an arched health bar?

Hey there! I'm extremely new to scripting and I had been searching all over for an easy to understand tutorial or how to on how to make an arched health bar. I found numerous rectangular tutorials but nothing that seemed to not use "rectangle" in the script so that I could adjust what I needed.

So I wanted to see if you kind gents wouldn't mind pointing me in the right direction on how to go about making the needle on my health bar rotate from full health (far left) to empty (far right). I figure for now it would be a simple 0-100 type thing just so I can figure out how to get it working.

alt text

Thanks in advance just for taking the time to look at this post.

healthguage.png (37.4 kB)
Comment
Add comment · Show 7
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 AlucardJay · Nov 26, 2012 at 02:05 AM 0
Share

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

avatar image dreamevolved · Nov 26, 2012 at 02:58 AM 0
Share

I saw that page, but how would I make this work with the needle rather than the color?

avatar image AlucardJay · Nov 26, 2012 at 07:46 AM 0
Share

sorry, I mis-read, well saw the title and the graphic and assumed really. Glad you got the answer to your actual question!

avatar image dreamevolved · Nov 26, 2012 at 01:12 PM 0
Share

Oh no problem! Now to just figure out how to set up health loss and connect it and what not. lol

avatar image Fattie · Nov 28, 2012 at 12:52 PM 0
Share

ALU .. that's such a great post by Eric isn't it ?

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by Loius · Nov 26, 2012 at 03:45 AM

Well with a needle ("pointer" of any kind) it's super easy - make the needle be its own object, and just spin it to match the health ratio.

needle.transform.rotation = Quaternion.Euler( 0, needleDegreeOffset + health/maxHealth * needleDegreeRange, 0 );

Comment
Add comment · Show 3 · 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 dreamevolved · Nov 26, 2012 at 03:51 AM 0
Share

Thank you so much! I'm such a noob at program$$anonymous$$g and just couldn't figure out the code for this.

Thanks again!

avatar image Fattie · Nov 28, 2012 at 12:51 PM 0
Share

Dram -- you should go ahead and ask a NEW, SEPARATE question about your next interesting question. O$$anonymous$$?

people will be glad to help.

avatar image dreamevolved · Nov 28, 2012 at 01:43 PM 0
Share

Thank you for the recommendation! I will go ahead and do just that that!

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

12 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 avatar image

Related Questions

Splitscreen w/ different GUIs on each camera 2 Answers

Healthbar not always working, someone please help! 2 Answers

[help] enemy Health Bar decrease at the same time 2 Answers

Creating A GUI health bar 0 Answers

OnGUI() not showing anything 2 Answers


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