Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
2
Question by iceblitz · May 24, 2011 at 03:34 PM · progress-barhealth

How do i add a healthbar/actionbar gui

I am in no means an expert in coding or indeed in unity. I've only just begun with it so excuse me if this would seem somewhat of a newbie question. Before i posted i did search but couldn't come across anything that answered what i wanted.

What i would like to do is have my own person health gui and action bar ingame, i've threw up these mocks in Photoshop. Excuse the poorness of these as i did not put any effort into them.

Action Bar

alt text

Colour codes: Green: Minimap Red: Health, player experience points(actionbar) Blue: Mana, spellbuttons(actionbar) Black circle: character window.

The One above is an action bar the one below is an health bar. once again excuse the poorness as it was just a means to help better express what i want to ask. What i want to ask is a few of things.

1) How would i implement this into my game?

2) How do i make the black window of the health bar to have a moveable 3d image of the 3d player, much like in games such as world of warcraft?

3)How would i add the minimap?

4)How would i add spellbars?

I know its somewhat of a lengthy request but i figure overall in my project this will be the most vital. I have photoshoped an image with these just so you may get what im on about. alt text

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

4 Replies

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

Answer by Meltdown · May 24, 2011 at 05:14 PM

A lot to answer in one 'question' but I will try my best...

  1. For the health bar, there are so many Unity tutorials on the net, and on these forums, that I'm sure you'll find something you need.

  2. If you have Unity Pro, I would suggest having a render texture, have another camera on your character in his idle pose, then render that camera's view to your black window.

2b.) If you don't have Unity Pro, you can do a similar thing by having a second camera, and pointing it to an idle version of your character somewhere hidden in your scene. Then set that camera's 'depth' property to 1, and your main game camera 'depth' to 0. Cameras are drawn from low depth to high depth. Which means a camera with a depth of 1 will be drawn on top of a camera with a depth of 0.

  1. The minimap works the same as in 2b above. Create another camera high up facing down on your world, perhaps attached to your player, so as your player moves the minimap shows centered on your player. Set the camera depths as previously instructed.

  2. Refer to 1 to get started on your spell bars.

Good luck

Comment
Add comment · Show 2 · 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 SirGive · May 29, 2011 at 07:44 AM 0
Share

I know this is a bit late, but isn't rendering multiple camera's really a bad choice because of the heavy process of rendering the scene multiple times over?

avatar image Meltdown · May 29, 2011 at 09:41 AM 0
Share

It of course affects performance negatively. What alternatives would you suggest?

avatar image
1

Answer by buskins · May 30, 2011 at 01:11 PM

look uo tornado twins videos they have great tuts on how to add health bars,and btw your game looks awesome. i want to buy it!

Comment
Add comment · 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
0

Answer by iceblitz · May 24, 2011 at 07:05 PM

Thanks for the reply, I have looked myself at some tutorials however they wern't what i was looking for, however i will progress with more scripting and maybe I'll be able to figure it out. Just out of pure interest what would be the script for 2b? or could you point me to a location where i could find it.

Many thanks.

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 flaviusxvii · May 24, 2011 at 07:52 PM 1
Share

Don't reply in answers.. use comments.

avatar image Meltdown · May 25, 2011 at 04:51 AM 0
Share

2b is not a 'script'. It is simply having two cameras in your scene, each with different depth, looking at different things. Play around in Unity with the cameras and depths and you will see what I mean

avatar image iceblitz · May 28, 2011 at 03:28 PM 0
Share

ah awesome Well thanks very much, ill indeed continue to play around with it.

avatar image
0

Answer by questionsforunity · May 24, 2011 at 08:21 PM

o.k if u really want a health GUI look here this is a little video i put together for a health bar http://www.youtube.com/watch?v=7iyiYgTjR1c hope it helps u good luck P.S. Beautiful artwork in the game. once its out i may need to buy a copy

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 iceblitz · May 28, 2011 at 03:31 PM 0
Share

Thanks very much, i will indeed look at this video, i had seen it before by i guess i was being too hasty about crossing it off the list. Also thanks very much, currently just setting up the code for it all so should be available soon :)

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

progress bar 1 Answer

How would you make an energy bar, loading progress bar, health meter, or other visual gradually fill up? 6 Answers

Creating a Lifebar with simple GUI in C# 3 Answers

Progression height affected by the width ? why 1 Answer

Heath Bar and Enemy 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