# Actor Begin Overlap in function

**URL:** <https://forums.unrealengine.com/t/actor-begin-overlap-in-function/815721>\
**Category:** Programming & Scripting\
**Tags:** triggerbox, unreal-engine, function, box-overlap\
**Created:** [March 24, 2023, 9:27am UTC](https://forums.unrealengine.com/t/actor-begin-overlap-in-function/815721 "2023-03-24T09:27:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![remzXD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/remzxd/32/636621_2.png) [@remzXD](https://forums.unrealengine.com/u/remzXD)\
**Post date:** [March 24, 2023, 9:27am UTC](https://forums.unrealengine.com/t/actor-begin-overlap-in-function/815721/1 "2023-03-24T09:27:18Z")

</div>

Hello,

I have multiple trigger boxes, and a boolean is set to true if the good trigger box is overlaped (I compare the name of the trigger box with the GuessNumber).

I would like to implement a function to simplify the code. In the blueprint level, I can left click and choose “Add Event for Trigger Box” \> "“Collision” \> “Add on Actor Begin Overlap”. However, in my function (in blueprint level), I can only create a reference to my trigger box but I can’t choose collision like in the blueprint level.

I would like to compare the variable GuessNumber with the name of my trigger box.

Level Blueprint code :

 ![BP_level](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/1/3/8131cd28fe88c082cc04377929b0729ec4a8a16b.png)

Function to replace the above code :

 ![guess_function](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/0/c/e0c83f8d5371f981bb24b09130e8289c61562b7c.png)

How can I get the name of the trigger box being overlaped in the red arrow ?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 24, 2023, 9:47am UTC](https://forums.unrealengine.com/t/actor-begin-overlap-in-function/815721/2 "2023-03-24T09:47:18Z")

</div>

Avoid relaying on `Display Name` - it will eventually backfire. Instead, try the following:

- tag the trigger boxes:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/0/4/00467d7bcbef727fd81239526e7084ce3ada06d1.jpeg)

- in the Level Blueprint:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/e/27e0fcab8bc747123c7e8d323454214ed19d8c05.png)

* * *

You can use integers and convert them if that’s more convenient, of course. But Name types are handy and easier on our human eyes and brains. It easier to decipher what _CorrectBox_ means rather than remember what 3 refers to.

You could even give a tag to the Good Trigger and then compare the two:

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

- `Overlapped Actor` is the _Trigger Box_
- `Other Actor` would be the _Good Trigger_

---

<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 24, 2023, 9:47am UTC](https://forums.unrealengine.com/t/actor-begin-overlap-in-function/815721/3 "2023-03-24T09:47:55Z")

</div>

Or:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/d/6/bd6e43997173f9c7e48784dcd213d5f93f0d8a59.png)

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

---

<div class="post-metadata">

**Author:** ![remzXD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/remzxd/32/636621_2.png) [@remzXD](https://forums.unrealengine.com/u/remzXD)\
**Post date:** [March 24, 2023, 10:21am UTC](https://forums.unrealengine.com/t/actor-begin-overlap-in-function/815721/4 "2023-03-24T10:21:07Z")

</div>

Thanks, your second solution works perfectly 🙂
