The AnimatedSprite2d is changing horizontally but the CollusionShape2d isn’t, here is the code:
if direction == 1:
$AnimatedSprite2D.scale.x = 1
$CollisionShape2D.scale.x = 1
if direction == -1:
$AnimatedSprite2D.scale.x = -1
$CollisionShape2D.scale.x = -1
How can I fix it?
I tried changing it to flip.h but it threw me an error that it was out of scope, also my collusion shape is a rectangle.