How to spawn an actor on AIs death in paper 2d, 4.12

This is strange, it should not destroy unless it overlaps with the player. Did you connect the destroy actor after the cast?

ive notice that if i place the cigsbox into the world , and the ai walk over and touch it, it is also destroyed, does this mean that onComponentOverlap applies to anything with a collision box? if so how can i make it so that it only applies to player character bp?

Like I said you need to place the destroy function after the cast function (and after any function that need to execute before the box is destroyed).
On component overlap will be called anytime anything overlap with your box, casting to your player character is a way of checking if the overlapping component is the player character,

Sorry, i didnt see the comment where you said to put it after the cast.
But THAT WORKED!!! thank you so much for your help. ive been fighting with this for 3 days.

Glad I could help :), and I hope you’re more familiar with blueprints now

Very much so, this is my “learning project” so alot of this is me looking for tutorials and or trial and erroring my way through, to figure out the blueprint language.

not only was i able to apply the concept of “casts” checking to see if its that component, to fix this problem, but i was also able to use it to fix my scoring system too. this has now fixed 3 of my problems.

I’m really glad to hear that :slight_smile: