Topic was automatically imported from the old Question2Answer platform.
Asked By
banana_bush
After flipping the sprite I had to flip the collision polygon. I used this code to do the flipping:
$CollisionPolygon2D.scale.x *= -1
The problem is that after this the program takes the collision polygon’s x value as it’s bottom right corner, instead of it’s bottom left corner (not 100% sure about this, but I think this is what is happening). Because of this this the sprite and CollisionPolygon2D are not alined.![1]![2] I have tried everything i could think of but nothing woks.
i might be wrong but i think is not recommended to affect the shape of collision shapes and polygons using Transform because it can affect the behaviour of the physics. with CollisionPolygon2D you can re-arrange the position of the PoolVector2Array points of the polygon property in the inspector setting them to new positions when your character flips
like: