GUI Health Bar Tests


So it is totally fine as it will only run once at load time, it should not change the FPS afterwards


ohhh whoops i forgot to add it into the preload list. hahaha.



Is there a way i could somehow add this to my AssetManager?

Im thinking making it an async function then maybe i could add it somehow…

Any ideas?


You will have to manage it your code, there is no custom task in asset manager, they are here to manage remote load.

You could do smthg along those lines:


Hey thanks!

Although the scene._addPendingData was a bit tricky to get working, this all worked phenomenally,
Thank you @sebavan for the help!!!


Sorry for the sudden jump in, I just want to mention that its something that I already have implemented in my own personal project. Atm, stuff is wonky due to new changes to babylon source but you can get many health bars updating in realtime on screen with multiple AI agents like so:


I hope it helps !


Hey everyone, doing some more work on this, i noticed that when i switch around the unit types it becomes jittery.

Any ideas how to fix that?


is there a way to have the image anchored somehow? Such that its still a child(or container.addControl(image) pretty sure that is a parent child relationship) of container, however when container moves, it does not?

Maybe i should be using getParentLocalCoordinates somehow instead…:thinking:

(im currently looking for a way, havent found one yet)


What do you mean?


uhm i think i made a mistake, im still lookig into it. I think it is only on my game, not in the playground. What is happenning is that, im trying to this with percent instead of just reducing top by 1 each frame. However i get a jitter, as it goes down, i believe it is because im converting a float to pixels which doesnt work perfectly (from what i understand). However i tried ceiling my units and it has not helped.

Still looking into it, however i believe, it is just a floating point problem not a babylonjs problem.

Sorry for the confusion.


Yeah it was just a floating point conversion to pixels problem. Fixed it by ceiling some numbers.

(i also reduced the percent to 3 decimal points)


Ok problem solved then :slight_smile: