Hello, I’m new to godot and I’m trying to understand it while attempting to create a platformer.
I’m having some problems trying to flip the collision shape of my character’s sword, so that when the character is facing left, the collision shape is also turned left.
I thought about updating the direction of the sword shape along with the character like this, but apparently it’s not working:
@onready var sword_collision_shape: CollisionShape2D = $Sprite2D/WeaponArea2D/WeaponCollisionShape2D
...
func update_facing_direction():
if direction.x > 0:
sprite.flip_h = false
sword_collision_shape.scale.x = 1
elif direction.x < 0:
sprite.flip_h = true
sword_collision_shape.scale.x = -1
Any tips?