Definitely just a developer debug UI

The HealthDisplay is really a q&d approach. Updating the UI on every Update() when most of the time its value doesn’t change… getting the component in Update() again and again (well, I certainly didn’t do that although I still did a fairly q&d implementation for it by adding a [SerializeField] to throw the UI text field into). And not using TMPro also means no easy outline or shadow for the text on the screen…

This might be the UI code to do in a Game Jam…

Side-node: I put the script on the canvas, not the text field…
I’d rather have one “HUD” UI canvas object being in control for all the UI elements that are beneath it in the UI object hierarchy than scattering scripts over random items. Maybe if there was some UI with health/mana/etc bars rendered in world-space above each character, but then it would still be that one UI canvas to put on each character…

that’s why events exist. From my understanding, subscribe to an event that’s only called once each time a change happens, and boom problem solved :slight_smile:

I’m not sure if I did that solo or as part of the course back then, but I have that too. Fun fact, mine disappears as well after some time :smiley: (I don’t mind sharing the code if you want it)

Exactly. One can do much more with events than just that…

World-Space healthbars on each character is shown for example in the turn-based strategy game course.

1 Like

You guys are SLOWLY tempting me to save up some money to get the turn based course, although it has nothing to do with what I’m trying to make… :stuck_out_tongue:

It has a lot of valuable content for any type of game, actually :grin:

I have no doubt about that!

Privacy & Terms