# How can I destroy an actor while overlapping with a collision box?

**URL:** <https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, UE4-27, question\
**Created:** [March 27, 2022, 5:31am UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038 "2022-03-27T05:31:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meshii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meshii](https://forums.unrealengine.com/u/Meshii)\
**Post date:** [March 27, 2022, 5:31am UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/1 "2022-03-27T05:31:59Z")

</div>

I’m trying to destroy an actor when I press “E” and while the player is overlapping a collision box but I can’t get it to work. I’ve tried to many tutorials and I’m stumped. The overlapping works but pressing “E” Still does nothing.

I’m currently on 4.27, any help is greatly appreciated. Thanks

 ![c4a311ecd9a81644a1f1ab1e911a719e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/2/e92e74d4a5e8db68764707ab85e294f306b14b37.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 27, 2022, 9:06am UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/2 "2022-03-27T09:06:38Z")

</div>

It looks ok. So the overlap message triggers, but the destroy not? Do you keep getting the overlap message?

---

<div class="post-metadata">

**Author:** ![Yepkoo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/yepkoo/32/676269_2.png) [@Yepkoo](https://forums.unrealengine.com/u/Yepkoo)\
**Post date:** [March 27, 2022, 9:18am UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/3 "2022-03-27T09:18:30Z")

</div>

I’ve done this with UE5 and there are no issues.  
You need to provide the link of the character to be destroyed in the destroy target part.  
Also you don’t need to use visibility for a character that will be destroyed anyway.  
You can try it like in the video I prepared.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/f/c/8fc8d19ec76dda7ff40533f42b309ab653a8e741.jpeg "Destroying a character by keyboard or collision using Unreal Engine 5 and trigger box") ](https://www.youtube.com/watch?v=yh2eJyn_31U)

---

<div class="post-metadata">

**Author:** ![Meshii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meshii](https://forums.unrealengine.com/u/Meshii)\
**Post date:** [March 27, 2022, 9:53am UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/4 "2022-03-27T09:53:35Z")

</div>

The overlap message triggers when I enter and the non overlap messages when I leave it. But the destroy never triggers.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 27, 2022, 9:58am UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/5 "2022-03-27T09:58:21Z")

</div>

Does any of the stuff on the E-chain fire?

---

<div class="post-metadata">

**Author:** ![Meshii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meshii](https://forums.unrealengine.com/u/Meshii)\
**Post date:** [March 27, 2022, 9:58am UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/6 "2022-03-27T09:58:43Z")

</div>

I’m using a collision box in the blueprint itself and want the object to disappear but the player to stay alive. I can’t figure it out

---

<div class="post-metadata">

**Author:** ![Meshii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meshii](https://forums.unrealengine.com/u/Meshii)\
**Post date:** [March 27, 2022, 10:00am UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/7 "2022-03-27T10:00:48Z")

</div>

Nope, none of the blueprints on E trigger. I’m guessing it’s because I’ve put it in the BP of the item being destroyed and not the player? Somehow need it to trigger when the player does it

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 27, 2022, 11:11am UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/8 "2022-03-27T11:11:26Z")

</div>

The code is a bit over the top, and actor overlap works better than component. Try more like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/a/08a08b8932c84c100138c6a108fdff91158f0c1f.png)

---

<div class="post-metadata">

**Author:** ![Meshii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meshii](https://forums.unrealengine.com/u/Meshii)\
**Post date:** [March 27, 2022, 12:36pm UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/10 "2022-03-27T12:36:40Z")

</div>

Thank you for the help but it’s still not working for me. Should I be putting this in the Actor being destroyed BP or the ThirdPersonCharacter?

I’ve currently got it in the actor being destroyed and even a simple “E Pressed - Print Hello” isn’t working in there.

---

<div class="post-metadata">

**Author:** ![Yepkoo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/yepkoo/32/676269_2.png) [@Yepkoo](https://forums.unrealengine.com/u/Yepkoo)\
**Post date:** [March 27, 2022, 1:03pm UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/11 "2022-03-27T13:03:52Z")

</div>

Hey! I think this video will do the trick  
I didn’t work according to your code, but I used the same system.  
You can use the actor’s own blueprint system you want to destroy.

You can watch from the 2nd minute.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/0/8/2083b483d80861ee3aa8c3d500d5b45d2758f282.jpeg "Unreal Engine 5 - Collecting items or gold by keyboard shortcut or touch") ](https://www.youtube.com/watch?v=98ZHR4joP18)

---

<div class="post-metadata">

**Author:** ![Meshii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meshii](https://forums.unrealengine.com/u/Meshii)\
**Post date:** [March 27, 2022, 2:56pm UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/12 "2022-03-27T14:56:30Z")

</div>

Thank you for the video, I’ve just tried it out and it hasn’t worked for me. It doesn’t seem to pick up any inputs on the BP that the character is pressing.  
The object I’m trying to destroy is a Character ClassBP so that might be something to do with it?

 ![00e9a3fc76d936044651126275e2946c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/2/6/1263fde7eb843fe39971bcaefa99bedad95f7fad.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 27, 2022, 4:27pm UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/13 "2022-03-27T16:27:24Z")

</div>

Enable input on the blueprint manually:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/b/8/3b80e25be35373a167e34a558400df1b1b9b9798.png)

---

<div class="post-metadata">

**Author:** ![Meshii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meshii](https://forums.unrealengine.com/u/Meshii)\
**Post date:** [March 27, 2022, 4:31pm UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/14 "2022-03-27T16:31:12Z")

</div>

Still doesn’t seem to work when using a CharacterBP. I’ve made a version using the ActorBP and it works. Just trying to figure out if that’ll be okay since I wanted them to be an enemy AI

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 27, 2022, 4:32pm UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/15 "2022-03-27T16:32:12Z")

</div>

I think everybody here is assuming this code is in an actor. You can’t have this code in the character.

---

<div class="post-metadata">

**Author:** ![Meshii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meshii](https://forums.unrealengine.com/u/Meshii)\
**Post date:** [March 27, 2022, 4:33pm UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/16 "2022-03-27T16:33:35Z")

</div>

Ah sorry that’s my bad for not realising it soon. I might have to find another way to have the enemies destroyed like that then, since ActorBP can’t have movement from what I can see

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 27, 2022, 4:34pm UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/17 "2022-03-27T16:34:54Z")

</div>

Ah, it’s an enemy, that’s different.

As long as the enemy is a character and the player overlaps with the AI collision, and you enable input on the AI.

---

<div class="post-metadata">

**Author:** ![Meshii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meshii](https://forums.unrealengine.com/u/Meshii)\
**Post date:** [March 27, 2022, 4:38pm UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/18 "2022-03-27T16:38:37Z")

</div>

Yeah so the plan was to have a collision box on the back of some enemies so that when the player walked up and entered the collision box and pressed E, the enemy would be destroyed. If done the exact same code that you’ve suggested on the an Actor and it works perfectly, but doesn’t work on the enemy

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 27, 2022, 4:44pm UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/19 "2022-03-27T16:44:50Z")

</div>

I’m guessing the input isn’t enabled on the AI. Have you enabled it?

---

<div class="post-metadata">

**Author:** ![Meshii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meshii](https://forums.unrealengine.com/u/Meshii)\
**Post date:** [March 27, 2022, 4:46pm UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/20 "2022-03-27T16:46:05Z")

</div>

The Auto Receive Input option is currently set to Player 0 on the AI

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 27, 2022, 4:48pm UTC](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038/21 "2022-03-27T16:48:04Z")

</div>

Ok, good.

I was just about to google this, and remembered: You can’t enable input on AI, I don’t think.

It will work if you make a custom event in the AI, and call that instead of trying to get keyboard input working. It’s because your keyboard input is already on your player.

[Next page](https://forums.unrealengine.com/t/how-can-i-destroy-an-actor-while-overlapping-with-a-collision-box/510038.md?page=2)
