Hello, I'd like to make a visual HP Bar on the HUD that visually updates to reflect HP depletion. To make it even easier, the bar is split into 10 'chunks' between empty and full, and the Combatants HP will be an even 100. Every loss of 10 HP knocks a segment off. I've gotten a few helpful tips on how to do this on the Discord, but this seems like one of those things that could be done in a variety of ways, and I'm looking for the easiest/simplest/cleanest way to do this within Ork's framework.

I've looked around and the below link seems to touch on it, but I'm not sure quite how to do it. Below is an example of how this HUD will look (full HP example below) and how the bar will update itself as HP goes up and down.

https://orkframework.com/guide/documentation/ui-system/huds-value-bar-content/

image

image
  • Instead of the Value Bar Content version of the component, use the Icon Bar Content version (e.g. ORK HUD Icon Bar Content for ORK-specific display.
    This uses prefabs (with regular HUD Value Bar setup, e.g. using sprites) to display defined chunks of the displayed value, e.g. each icon/prefab displaying a value of 10, or 4, etc.

    You can set up pre-placed icons for your layout, or use one of the layout components to handle the layout of the created prefab icons.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks, that gave me a little more insight. But because its UI stuff, I'm having a little trouble. I threw down my setup in a link, can you take a look? Still fiddling but having trouble.

    https://imgur.com/a/R308uNe
  • The regular HUD Value Bar (Sprite) stuff should be set up as a prefab. The ORK HUD Icon Bar Content component uses the prefab to create the individual bars for the displayed value.

    So, remove the ORK HUD Icon Bar Content component from the game object, make a prefab out of the Value Bar (Sprite) child object, remove it from the HUD and add the ORK HUD Icon Bar Content e.g. to the Health HUD child object and use the prefab from the value bar in it. The icon bar will create prefab instances as needed for the value.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited January 18
    Still no go. What it's doing is;

    My Max HP is 10, and I'm basically telling the HUD Icon Bar Content (in the 'Health HUD prefab), is to utilize the Value Bar prefab to adjust the sprite its displaying based on the information its getting from the HUD Status Value Content Provider (in the 'Health HUD prefab), set up to pull from the Health Points Status Value.

    The way its set up now, is that it duplicates the Value Bar prefab 10 times (because my HP is 10).

    https://imgur.com/a/cxSSaJX

    What I want it to to is to change that health bar sprite to another health sprite (each sprite representing how much health is remaining, example above) depending on the HP percentage remaining. Basically, how this would look is a segmented health bar like this;

    https://art.pixilart.com/75f1025507a19ca.gif
    https://i.imgur.com/y3LqfSh.png

    The Health Bar is divided into 10 segmented, and each 10% lost/gained changes the sprite into the appropriately segmented one.

    Post edited by FeldFour on
  • Ah, ok, that can be set up either as icon bar (with each segment using a pre-placed icon for one of the colored squares), or with a regular value bar where the sprite is the full bar with the segments colored as you want, e.g. putting another sprite on top of it for the divisions or something like that.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.