Cant delete actor in bp

So I’m modifying the BP_ThirdPersonCharacter that comes with the third person project. Below is how i’m checking if the player is close enough to the box I have to pick it up. The box is a bp_actor that i created and I try to store it in the variable boxSeen. Overlap box is a bool i set to check if the box is overlapping.


The next image is the logic for attaching the box to a socket. This works, until the end where I connected the exec from Attach Actor to the node Destroy Actor. I’m using my box seen variable for the target so I assumed it would destroy the box I had set in the world. However, when that node is connected, the box no longer attaches to a socket, it just doesn’t do anything. I’m assuming that somehow BoxSeen is all bp_actors in my scene? If that is so, how do I reference the specific object that it overlaps with? Or if thats not the case, any suggestions on what I’m doing wrong?

I read this few times and I believe this is what happens.
When you spawn Bp_Actor, your Box Seen variable is set to that newly spawned actor(overlap is triggered again), replacing the previous reference (one you had in the world and wanted to pickup) so when you connect destroy actor, you in fact destroy newly spawned actor. You can verify this by adding a print node to your overlap event to see when/how many times it’s been fired off.
I hope this clears things out for you.

Try attaching the actor (you have the reference) you pickup without having to spawn new one in the world.
I suggest you add a variable inside your pickup object, a boolean (attached?) so you can set it to true when you have attached Bp_Actor to player. You would use this variable as a check on your overlap event to avoid what I described above.