I’m attempting to have my HUD display how many lives my character has left (I have this defined by an integer) via images of hearts. The idea is that when the character has 5 lives left, the HUD will display 5 images, lose a life, lose an image etc.
For this i would create a container that holds my images. get the number of childrens available in the container and then just use a forloop. And in the loop check if the number of lives is less than the current child index. If its less just hide the image. If its more show the image.
Hope it helps.
My other idea would be to use a progress bar but im not sure if thats doable i need to check.