My problem is, I think simple. If the enemy facing left it detects player but if facing right it's not. What's the case?
Hitbox/CollishionShape is the area of the enemy, when area entered by player play animation attack.
if direction == 1:
$Sprite.flip_h = false
$Sprite/Sprite2.flip_h = false
$Sprite/Sprite2.position.x = 50
$HitBox/CollisionShape2D.position.x = 376
$Sprite.flip_h = true
$Sprite/Sprite2.flip_h = true
$Sprite/Sprite2.position.x = -50
$HitBox/CollisionShape2D.position.x = 156