Impulse dont work if a ennemy is in front of me

As I said in the title, my character has an impulse when he attacks, this impulse only works if there is no one in front of him, from the moment an enemy is close to him he no longer applies the impulse. I’ve tried changing the collisions but nothing changes, or maybe I didn’t change the right collisions but it doesn’t work.

Important information to know: I have a piece of code that makes it so that if an enemy is close to my character and I attack, the character turns towards the nearest enemy.
I’m adding the code as an image and a video where you can see at the beginning that when I attack the enemy nothing happens but when I’m alone the character applies the impulse.



[2023-07-08 14-01-50.mkv|attachment]

Link of the video : Impulse dont work - YouTube