It’s not going down at all from the click event. If I move the two ‘Change width…’ up one level … The cursor/touch is on BLOCK… then it does work but not as expected.
Can’t tint them correctly so use your imagination
On the left that broken bricks object is your yellow block
Above player broken bricks object is your blue block (healthbar)
Now this YellowBlock.Variable(Health)/100*120
YellowBlock.Variable(Health) variable which i set on yellow block to 100 called Health
/100 that 100 Health which is max Health
Since Health variable will change (decrease) i just put there number as indication what is the max Health
*120 is vertical size in pixels of that object so engine knows what is 100% of vertical size and can change it size proportionally to how i decrease HP
Now you just click on the block on the left which is your Yellow block and the block above player which is Blue block (healthbar) will shrink
When it reaches 0 Health it will be deleted
I’m not sure why you’re using an object variable. You could use scene variables named health and maxHealth. Also, Gdevelop now includes resource bars that accept a value.