Sorry for not being clear but also the lines that set flip_h true/false have no effect on the code.
Though global_position helped to get some kind of signal to execute the if statement.
SlavJuan | 2020-07-24 18:50
Check that you used == while trying to set the variables… it should be =
p7f | 2020-07-24 19:03
I’m trying to make the character flip to the left when he is walking left and flip to the right when he is walking right and it says this “invalid set index ‘flip_h’ (on base: ‘null instance’) with value of type ‘bool’.” Please could you help I’ve been stuck on this for a few hours and I don’t know how to fix it. This is the script I am using:
Thats probably because sprite is not a valid reference to the node… can you show an image of the tree, and the portion of the code when you declared sprite?
p7f | 2020-09-01 00:09
I’m sorry but I am new to programming so I don’t really get what you mean. I don’t have a tree. I only have a Tile and a Character.
kokickosta | 2020-09-01 17:24
The tree is the hierarchy of nodes you see in the scene dock. Im guessing you are trying to access sprite, but the path to the node that actually holds that sprite is wrong.