Its a bug sorry im new to coding.The only thing i can thank of is to make sure the dot in front of the player
is on the enemy.