Destroying actor if colliding and key is pressed

Whatif you try to set collision preset to overlap only pawn?

Im trying to do smth simple, if my character is in the collision box of an actor and I press E key, the actor will be destroyed.For some reasons in I put 3 actors on the ground I can only destroy them in the order that I put them.For example :I cant destroy the 2nd cube if I dont destroy the 1st one.How can I fix it?Btw,the code is done in the actors event graph.

It makes no difference.I still have to destroy them in the order that I put on the ground…

Create a boolean for if the e key is pressed and then for each item have the on begin overlap with an if of for example ‘EKeyPressed’ and if true then destroy actor. That would be my solution though there may be a better way.

It`s not working.

Let me see if I can recreate your issue and find a solution…

Its not hard to recreate, its hard to fix it.I have no idea how

Try instead of ‘destroy actor’ to use ‘destroy component’ and then reference the static mesh. That seems to work for me

I solved it, but thx for the idea.

Ah great! What was your eventual solution?

Start overlap - - - enable input, end overlap - - - disable input, pressed key - - - destroy actor

nice workaround xD