Want to add an HP gauge to enemies

I always enjoy creating with you.

I was able to create various gauges, such as a health gauge, for the game scene using the UI. However, if possible, I would like to display a health gauge below (or above) the enemy, but I don’t know how to do it. I thought about having the enemy emit an object (the gauge) that synchronizes with the parent, but I’m unsure whether it’s even possible to emit a gauge as an object, and if so, how to do it.

If anyone knows the method, I would appreciate your guidance.

If the goal is simply to follow the monster’s health bar, this node can achieve that.
The AGM node can automatically bind to variables, which is very convenient.
In the red box below, you can add the desired health bar image asset.

I’m happy that it seems like I can recreate exactly the gauge I want to make. Thank you for the information.

If I may ask for one more thing… As it stands now, the gauge is basically consumed from right to left. However, when the enemy faces the opposite direction, the consumption direction of the gauge also reverses. I’d like to adjust this so that the gauge’s direction remains fixed regardless of the enemy’s orientation. It feels like there might be a setting for this somewhere, but I haven’t been able to find it yet… I apologize for bothering you again.

I consulted with AI to help you implement this feature simply and have personally tested it with no errors.

The specific cause of this issue is that the health bar is placed on a child node, so it flips along with the parent node during animation.

The core solution is to use a separate isolated layer to separate the health bar from the parent node’s layer.

(1) Create a Node2D below the object and place the health bar underneath it.
(2) Create a RemoteTransform2D node and set its path to this Node2D.

(3) In the “Update” section of this node, disable the “Flip” and “Scale” functions. (This means the new node layer will not flip along with the parent node.)

(4) Enable the “Top Level” option for the Node2D, which corresponds to top-level. (I tested this, and if it’s not enabled, the flipping still occurs.)

OK, after completing these steps, the health bar will remain fixed and not flip.

Thank you for the tip! I was able to create exactly the gauge I was looking for.

ActionGameMaker seems to be capable of doing a wide variety of things depending on how you use it. We look forward to your continued support.

1 Like