Fliping a 2D Character using the root node

Godot Version

Godot 4.(?) (what ever the latest version is)


In my game I have to flip an enemy based on the position of the player (the game is 2D) I have to flip the enemy, its collisions, etc. but I dont know how to go through with this because i can’t use “.flip_h” because I am flipping collisions as well. I am a beginner so I don’t know alternitive solutions. I tried looking through YT and other topics but I couldn’t understand the vocabulary that was being used.

Any help is apreciated. Thanks!

You can use flip_h for sprite and create two collisions, first normal and second the flipped collision, then you can change them by disabled = true #or false

Thank you so much for responding, but is there any way to flip the collision shape, or not have to make two collisions?

1 Like

You can just inverse the scale of the body as mentioned here
@superplaystudios is correct

You can set x scale to -1 to flip object and it’s children