Enemy Weapon not destroying on duplicates

Hey all! I have an enemy AI where i have used a spawn actor and attach actor to component to put a weapon in their hand. I also created an event to destroy the weapon when the variable “isDead” is set to true. i then duplicated the enemy in my levels. The issues is that if i kill one of them, they explode (destroy actor with spawn emitter attached) but the destroy weapon doesnt work. the weapon just stays there floating in the air. Once i have killed all enemy AIs of the same type, all of the floating weapons disappear. Im kind of at a loss here. any help on this would be appreciated.

Hi @TLOA

Make sure you destroy the weapons BEFORE the actor otherwise the destroy weapon code will never execute.

Thanks for the reply! I have a sequence node in place that executes the weapon destroy and then the enemy AI. Is the sequence node sufficient?

It should work, but I’d go the polling route and check Is Actor Being Destroyed.

On True → Fire off the destroy for the pawn.

It works all the way through. The behavior is odd though. Sometimes killing one makes all of the enemies lose their weapons, other times you have to kill all of them beforethe weapons all destroy. Its like there is a master. I feel like my only option here is to have a seperate blueprint for every enemy of the same type. Id end up with thousands of blueprints when its all said and done.

Solved by setting weapon attached as a variable. Then added another destroy actor node after my self destroy node with the weapon variable as target. So simple :confused: