# When the player touches two things, it dies

**URL:** <https://forums.unrealengine.com/t/when-the-player-touches-two-things-it-dies/466478>\
**Category:** Community & Industry Discussion\
**Tags:** death, box-trigger, unreal-engine, question\
**Created:** [June 9, 2020, 5:17pm UTC](https://forums.unrealengine.com/t/when-the-player-touches-two-things-it-dies/466478 "2020-06-09T17:17:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheActualNemesis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheActualNemesis](https://forums.unrealengine.com/u/TheActualNemesis)\
**Post date:** [June 9, 2020, 5:17pm UTC](https://forums.unrealengine.com/t/when-the-player-touches-two-things-it-dies/466478/1 "2020-06-09T17:17:02Z")

</div>

I’m having trouble making my character die when it touches two things, for a wall trap. I’ve gotten the walls to move together, but I can’t figure out how to make it so when they touch BOTH of the box collisions on the walls, the player dies.

---

<div class="post-metadata">

**Author:** ![EvilCleric](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvilCleric](https://forums.unrealengine.com/u/EvilCleric)\
**Post date:** [June 9, 2020, 6:16pm UTC](https://forums.unrealengine.com/t/when-the-player-touches-two-things-it-dies/466478/2 "2020-06-09T18:16:52Z")

</div>

Are the walls a single BP or is each wall an individual BP?

---

<div class="post-metadata">

**Author:** ![TheActualNemesis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheActualNemesis](https://forums.unrealengine.com/u/TheActualNemesis)\
**Post date:** [June 10, 2020, 7:33am UTC](https://forums.unrealengine.com/t/when-the-player-touches-two-things-it-dies/466478/3 "2020-06-10T07:33:24Z")

</div>

They were a single BP, but the walls kept jumping to the root scene, so I had to make them individual BP’s. Right now, I have a kinda key system with them, so when the player touches one, the game keeps it in mind until they touch the other wall and die. Because of how close the wall traps are, this works, but it’s not the best way to do it.

---

<div class="post-metadata">

**Author:** ![TheActualNemesis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheActualNemesis](https://forums.unrealengine.com/u/TheActualNemesis)\
**Post date:** [June 10, 2020, 7:33am UTC](https://forums.unrealengine.com/t/when-the-player-touches-two-things-it-dies/466478/4 "2020-06-10T07:33:40Z")

</div>

They were a single BP, but the walls kept jumping to the root scene, so I had to make them individual BP’s. Right now, I have a kinda key system with them, so when the player touches one, the game keeps it in mind until they touch the other wall and die. Because of how close the wall traps are, this works, but it’s not the best way to do it.

---

<div class="post-metadata">

**Author:** ![EvilCleric](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvilCleric](https://forums.unrealengine.com/u/EvilCleric)\
**Post date:** [June 11, 2020, 10:07am UTC](https://forums.unrealengine.com/t/when-the-player-touches-two-things-it-dies/466478/5 "2020-06-11T10:07:54Z")

</div>

This would be a lot easier if it was a single BP.

So, because there each wall is a BP, then we must ensure that the player is crushed / dies only when the 2 walls are “on him” simultaneously.  
So, I tried this script in the wall BP, where TileChar is the character and BP\_Walls is the wall BP:

 ![304154-2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/b/1/eb1640cd3bc4b04c6ee119254b8c368b46621928.jpeg)

Since this code exists in both walls, it will call the Die function twice, so you need to make sure that the player has a DoOnce in that function.

PS: maybe this is a little too much for such a simple task, but I enjoy trying new ways of doing things.

---

<div class="post-metadata">

**Author:** ![TheActualNemesis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheActualNemesis](https://forums.unrealengine.com/u/TheActualNemesis)\
**Post date:** [June 11, 2020, 10:11am UTC](https://forums.unrealengine.com/t/when-the-player-touches-two-things-it-dies/466478/6 "2020-06-11T10:11:22Z")

</div>

Thank you, EvilCleric; I will definitely take this into mind if I go back to the game. I’ve already finished my level (a 3d level design intro- so the teacher is expecting it to be a bit didge), and it’s submitted. But, thanks a lot for going into the effort of helping me :).
