Character attacking first AI only

I am preparing a SideScroller Game in UE5 . The AI i am using works perfectly fine but the only problem is , that when i drop multiple instances of my AI , (attacks are detected using line traces ) the player does not target the other instance of AI until the first AI completes its death animation.
I want the player to continue with the attacking as soon as the current AI dies.

Hi @DHA.21

Ok so all we need to know here is how you are detecting the ai death. At a guess i would say you are destroying the ai actor after the animation, so the player no longer has a target so switches?

You could just try a simple boolean inside the ai called bIsDead , set this at the start of the dwath animation, when the player traces for an enemy you can check this boolean. Or if the player already has a reference stored for its current target, you could detect the change to this boolean regularly, maybe even on tick :open_mouth:

The player automatically selects the AI as per the instances created, for example, the character attacks ENEMY1 , then ENEMY2 , (Also the character is only taking damage from the current target(AI instance)) and ignoring the other AI instances.