Actor Begin Overlap in function

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 :

Function to replace the above code :

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

Thanks in advance.

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

  • tag the trigger boxes:

  • in the Level Blueprint:


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:

  • Overlapped Actor is the Trigger Box
  • Other Actor would be the Good Trigger

Or:

image

Thanks, your second solution works perfectly :slight_smile: