Sprite.set_hflip flips the sprite whether the boolean is true or false (SOLVED)

Hello everyone,
I have a weird problem with the set_hflip method.

so my character is facing in the right direction. Now I add this single line into the update function:

sprite.set_hflip("#char_sprite", 1)

and it flips the sprite as it should.
But when I change the line:

sprite.set_hflip("#char_sprite", 0)

it is still flipping the sprite. Only if I remove the code line entirely it sets the char_sprite back to normal. Am I missing something?

Thanks in advance!
Luca

1 Like

In lua boolean false only ‘false’ and nil. Everything else is true.

2 Likes

Now I feel stupid, haha :smile:
Thank you very much! Obviously I’m still learning lua and all the differences compared to other languages.

1 Like

We have all been there… :wink:

2 Likes