(Solved) Trying to make an object show, code not working

So, I am trying to make a particular object show when the total is between a certain number.
To be precise, at the end of my game the total is displayed and my game is related to bees, so a honeycomb is supposed to show filling it according to the total. e.g total = 0, the honeycomb is empty
total = 13, the honeycomb is a bit full

this is the code:

this is what should show when the total is greater than 0 and less than 20

But this is what happens:

Please any suggestions? idk what to do.

Hi,

Is the z-order value of your hidden objects higher than the background?

I think the issue is the 2nd event.

The 1st event is good, converting the sum of 2 numerical variables to a string.

The 2nd event is converting the variables to a number and it’s assumimg the variables are strings so it’s combining them instead of adding them and then converting it to a number.

If the variables are numbers then the sum doesn’t need to be converted to a number. If they were strings then they would need to be converted to numbers separately before being added.

It’s the difference between

11+22 is 33 and “11” + “22” is “1122”

If the variables were strings
ToNumber(string) + ToNumber(string)

If they’re numbers
ToString (number + number)
Or number + number if you want a number

1 Like

yeah the z-order is higher than the background

Thank you so much, it worked!

1 Like