Topic was automatically imported from the old Question2Answer platform.
Asked By
Rmn337
I need to make a HPbar dor an NPC.
The ProgressBar is inherited from the control and therefore has no z-index.
I’ve tried putting the node in a CanvasLayer, but then it doesn’t move with the character. The question is whether it can be solved by build-in methods?
(Of course, I can give all nodes a negative z-index, but this is not good)
I am not sure why you dont want to use the z_index? This is the built in method in godot to decide which layers to draw in which order. By ensuring you put your sprites on appropriate z_index you can decide on the draw order.
ProgressBar haven’t z-index and ignore the parent z-index
Rmn337 | 2023-01-29 03:37
Okay well I am not sure what you want here, I have progress bars in my games and it always works perfectly you just need to order them above the other sprites. You can literally just make sure the node is lower down the scene tree than the other sprite nodes to order the z_index if that is easier.