# how to check if an actor is inside the trigger but not the player

**URL:** <https://forums.unrealengine.com/t/how-to-check-if-an-actor-is-inside-the-trigger-but-not-the-player/1169363>\
**Category:** Blueprint\
**Tags:** trigger, box-trigger, trigger-volume, unreal-engine, Physics, Collision, question\
**Created:** [May 18, 2023, 3:21am UTC](https://forums.unrealengine.com/t/how-to-check-if-an-actor-is-inside-the-trigger-but-not-the-player/1169363 "2023-05-18T03:21:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ha1ze23](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ha1ze23](https://forums.unrealengine.com/u/ha1ze23)\
**Post date:** [May 18, 2023, 3:21am UTC](https://forums.unrealengine.com/t/how-to-check-if-an-actor-is-inside-the-trigger-but-not-the-player/1169363/1 "2023-05-18T03:21:04Z")

</div>

I am trying to implement a logic where I shoot balls at 9 trash cans to make fall over the edge. I want to check if all the trashcans has fallen over the edge or not.

 ![image1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/1/4a1c969b6aac7bdd0870ca37a3e1b7c0506d4fed.jpeg)  
This is the level editor.

I have the player on one end and the trash bins on the other end. As you can also see on the top, I have an actor class for the cannonballs and also an actor class for the trash can and the trash cans are all placed using that actor calls. the only stuff of code is in the level blueprint to shoot balls on pressing space. the event graphs of the trigger box, trash cans and the cannon balls are empty. The aim is want to achieve is that i shoot 5 balls and the player all the 9 trash cans into oblivion. I logic i was thinking was by placing a trigger box where the trash cans are and using a counter and decrementing it every time 1 trash can leaves the trigger area. I tried few things but still cannot achieve this.

---

<div class="post-metadata">

**Author:** ![rokenrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rokenrock/32/1040844_2.png) [@rokenrock](https://forums.unrealengine.com/u/rokenrock)\
**Post date:** [May 18, 2023, 3:34am UTC](https://forums.unrealengine.com/t/how-to-check-if-an-actor-is-inside-the-trigger-but-not-the-player/1169363/2 "2023-05-18T03:34:53Z")

</div>

Inside your BP\_TriggerBox, on the end overlap of your collider, check whether you’re overlapping any trash cans. You could keep track, but this is cleaner and doesn’t require a variable.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/8/9/a89850e334e3a46196588f647e780ca58927e836.png)

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/a/4/9a45fdb68d827408e353c2aecd3fcd3bbd49ffe4.png)

---

<div class="post-metadata">

**Author:** ![ha1ze23](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ha1ze23](https://forums.unrealengine.com/u/ha1ze23)\
**Post date:** [May 18, 2023, 12:41pm UTC](https://forums.unrealengine.com/t/how-to-check-if-an-actor-is-inside-the-trigger-but-not-the-player/1169363/3 "2023-05-18T12:41:44Z")

</div>

I tried to use your advice but idk if I am doing something wrong.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/6/e/16e791fc01aaab4c7efa28328ee26ed74c387fb4.jpeg)

This is the blueprint inside the trigger box. Also I have placed Trigger Box in the level. Should I instead place a trigger volume? Also your components inside the trigger box looks different as I have something called sprite component.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/1/1/e118e72ab0a6075e005a30913a077e781adadb95.jpeg)

I have set the duration of the print string to 10 as to not miss the string and set the ball ammo to 10 have more than enough balls to knock all the bins off the edge. Even after knocking them all off the edge and out of the trigger box, no message appears on screen. I might be doing something wrong.

Let me know if you want screenshots of anything else.

---

<div class="post-metadata">

**Author:** ![rokenrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rokenrock/32/1040844_2.png) [@rokenrock](https://forums.unrealengine.com/u/rokenrock)\
**Post date:** [May 18, 2023, 2:31pm UTC](https://forums.unrealengine.com/t/how-to-check-if-an-actor-is-inside-the-trigger-but-not-the-player/1169363/4 "2023-05-18T14:31:10Z")

</div>

I didn’t realize you were using an actual triggerbox derived class- that’s why it’s different.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/8/e/c8e9110409a0607d2d927e38aeaf8c35976d9327.png)

Lead off of your end overlap event with a print node. If this doesn’t fire, you likely have the wrong collision settings on your trash can.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/5/2/85257d8d302dae44e250afdcce8e6435c37cd542.png)

---

<div class="post-metadata">

**Author:** ![ha1ze23](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ha1ze23](https://forums.unrealengine.com/u/ha1ze23)\
**Post date:** [May 18, 2023, 6:26pm UTC](https://forums.unrealengine.com/t/how-to-check-if-an-actor-is-inside-the-trigger-but-not-the-player/1169363/5 "2023-05-18T18:26:03Z")

</div>

Forget to turn on the collision for the trash cans. Your solution works like charm now

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [June 17, 2023, 6:26pm UTC](https://forums.unrealengine.com/t/how-to-check-if-an-actor-is-inside-the-trigger-but-not-the-player/1169363/6 "2023-06-17T18:26:22Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
