4.4.1 Godot Version
I have a dragon boss that I’m trying to flip so it can fly across the screen in a different direction. To do this, I’m trying to flip the scale.x, however for some reason the variable updates and seems to have no effect. The dragon just starts flying in the other directing without turning, so it ends up flying backwards
the -1.0 and 1.0 are the scale prints
Hi,
What is cycle[0][1]
?
Here’s another way of handling the scale: keep track of the dragon position, and every frame, check if its new position has an x
value less or greater than the previous one. If it is greater, do not flip it, else, flip it. Or the opposite, depends on your sprite, but you get the idea.
Setting scale in _process
for this kind of thing can be tricky as you actually only want to change the scale when the direction changes, but, if you’re to do it in _process
, using the node position is very safe and should work perfectly.
I kept working on it after submitting this and I found that sticking an extra node between the character body and everything else and scaling that worked just fine. I would have canceled the post but it was late and by morning I forgot about it.
Sorry for the trouble.