- Home /
Unity 5 - Health Bars above enemies
Hello! What is the best way to have hp bars above enemies? Currently I just make a small canvas and change its worldspace and attach to each enemy (about 30 enemies per Stage - 2D platformer)
But maybe this is not really good solution?
Answer by smokinsick · Aug 10, 2015 at 01:30 PM
It sounds better than putting it on the GUILayer and having to convert real-world(game) X, Y and Z (depending on your implementation) into GUI coordinates. However, if you do have a Z plane you may have the problem of the health bar's size getting smaller/bigger which may not be what you want visually.
Do you like the way the current solution works?
I didn't have any prbolems except the Text which is also above enemies. I made it font size 14 and scale 0.01 ... Any suggestions how could I do it differently? Font size 1 or 2 is not vissible.
Is the text for displaying a HP number/% or for enemy name?
Your answer
Follow this Question
Related Questions
GUI in front of 4.6 UI 1 Answer
Disabling canvas renderer optimization 4 Answers
multiple scenes or one? 2 Answers
World canvas with screen space canvas performance mobile ? 0 Answers
Script updates prefab but not instantiated clone of prefab 0 Answers