FillBar doesn't show up in front of the Resource Bar's background

What’s up, GDev forums?

I’ve gotten myself into a bit of a sticky-wicky, and I’m really unable to understand what I’ve been doing wrong.

See, I’ve been trying to create a custom Health Bar (continuous bar) for the characters in my 2D fighting game, and I’ve made a simple Fill Bar, a Background, and I’ve left no Buffer (since it’s optional anyways). The problem is, however, that the Fill Bar doesn’t show up in front of the Background. Not in the scene editor, and not when I preview the game. What gives?

The only thing I’d want is for the Fill Bar for, atm, to show in front of the Background. It’s pretty weird how it doesn’t.

These are the basic settings for the object:

These are the settings for both the FillBar and the Background Bar:


And this is a close look at how I want them to look like:


This is the Background Bar.

And this is the FillBar.

(And don’t worry about the shape of the FillBar, I’m planning on pasting a transparent version of the bar over it to maintain the same radical shape!)

And for another reference, this is how the bar should look like from a testing mock-up I made earlier:
image

Wanna do it with normal sprite object instead?

Only thing that looks wrong to me here is width of both objects being different where i do not use resource bars
So i have no idea why bg is going in front

1 Like

Something SUPER weird happened, where the next time I started up the engine, the FillBar worked…somehow. I just mostly tricked how I wanted it to look. I made the Fillbar as big as the Background was supposed to be, and edited it FillBar to have the parts of the background that were covered by it.

I then made a sprite with the transparent inside of the bar that I pasted over, covering it like some sort of sleeve. So…I kinda sort of followed your advice, but I used a bit of trickery to get the look it’s supposed to have.

WorkingHPBars
I say it works pretty good, so thanks!

2 Likes