How destroy child actor before parent animation starts?

Hello,

In the project I am working when the hero character dies, everything is destroyed at the end of the animation loop. However that leaves the gun floating on the screen when the death animation is playing.

I wanted to destroy the weapon as soon as my boolean returns true for IsDead,

I thought about connecting the scripts like so, however, when I add the extra scripts ‘inside the red box’ I get an error log.

During the simulation play it works exactly how I wanted, but after I finish the simulation Unreal Engine gives me some critical errors.

ERROR LOG

Blueprint Runtime Error: Attempted to access Weapon_C_0 via property Weapon, ut Weapon_C_0 is pending kill from function: ‘ExecuteUbergraph_BaseCharacter’ from node: DestroyActor in graph: EventGraph in object: BaseCharacter with description: Attempted to access Weapon_C_0 via property Weapon, but Weapon_C_0 is pending kill.

I am still new to blueprint I am just curious to know what I am doing wrong.

Thanks in advance.

If u attach weapon in construction script to actor’s skeletal bone this shouldnt happen.
1.Create bone socket in hand bone of mannequin in persona editor
2.Attach weapon to socket in construction script. Adjust angle and position of socket if need. You can preview weapon mesh in persona editor to see how it sits on your character