(Solved) Health bar problem

Greetings to all! I ran into a problem and I can’t figure out what’s wrong. When using an item that should set the value of the “health” variable of the scene to 100, the health bar jumps out of its proper edges, although its size, of course, is set by the code so that it looks like in the first screenshot. There are no problems with the value of the “mana” scene variable and its strip, although its sprite is, in fact, exactly the same and exactly the same code that sets its dimensions, except that the width of these two strips is divided into different values, because despite the fact that the sprites are absolutely identical, dividing by the same values results in different sizes👀. I also attach the code and a screenshot of the “unsatisfactory” result in the project. I hope someone can help me.




You’re using “Change the width’s scale” actions. Scale is a multiplier, not a fixed size.

You’re saying the variable is 100, and then your “Change the width’s scale action” does Variable/13

100/13 = 7. (Approximately)

So you’re saying “multiply the healthbar’s width by 7x”.

Are you sure that’s what you want? Because if your healthbar’s max value is 100, then you should be doing Variable / 100 (so 1x scale is “full” health).

2 Likes

I listened to your advice and tried to do the same - it turned out. I read an additional couple of topics on the forum and realized that I was not the first to encounter this. Thank you for your help