OnComponentBeginOverlap firing twice

I’m following along with the official Blueprint tutorials on Youtube and I’ve just finished watching [this lesson][1] which covers setting up Class Blueprints.

The basic setup is I have a light on a wall and when the player enters a box trigger, the light is supposed to turn on. When the player exits the trigger, the light should turn off.

The problem is that the OnComponentBeginOverlap event, which toggles the visibility of the light, is firing twice, once when my character first “touches” the trigger and again when I take another step or two into the trigger box.

The same happens with the OnComponentEndOverlap event. If I am fully inside the trigger and then slowly backup, the light will turn on when I hit the trigger boundary and then go off again as I exit.

I’m really confused as to what is going on as I was able to follow the previous Blueprint tutorial with a sliding door example and didn’t have any issues.

Here is my simple blueprint and current viewport:

I have something that work with that :

91486-capture3.png

directly in my lamp blueprint, maybe can you try it ?

Try printing the display name of the other actor to the screen…and also the “Other Comp” to see which component is triggering it. That most often leads quickly to seeing the problem.

My only guess as to why we get double overlaps is that there’s more than one component within our actors that are activating the actual overlap event. If you have the collision cylinder set to generate overlaps and the mesh with its collision set to do the same…it will see them both come through, as it actually should. However, with no relevancy checks in place, it’ll react to all of them.

Hopefully it helps.

1 Like

I believe you are right and that there are multiple components passing into the trigger, triggering it twice. In the FPS template, there is a Collision Sphere at the end of the gun barrel. If I turn collisions off on that sphere, the trigger only fires once and works correctly.

As a beginner, I still have a lot to learn about collisions and how they work when using multiple components but I’m happy that it isn’t a bug or anything.

Thanks.

Thanks. I tried to method as well and it works perfectly. To be honest, I think I like this method more than the one in the tutorial because you are explicitly setting the state rather than assuming that the toggle will perform the action you expect.

Hi. I am a bit too late here, but if someone has this problem in year 2017 - Try placing box trigger so that it won’t overlap anything else (like walls, static meshes, actors in the scene and so on). Doing so fixed it for me.

1 Like

For anyone struggling with overlap events firing twice in 2049 - I found that probably those events are firing for each parent the component has. Its best to place the collision box as a root, but as we all know its not always possible. I found a workaround, just add “Child Actor Component” and “Bind Event to OnActorBeginOverlap” on the child (be sure to set the collision on the child actor). This way you can have many collisions on one actor, managing everything inside viewport of blueprint editor, very convenient. I haven’t tested it enough but it works and I hope this post will help someone. :slight_smile:

Had the same problem, found out that my static mesh and trigger box triggers the overlap the same time. Disabling “Generate Overlap Event” of my static mesh fixed my issue.

Thank you, this has fixed my issue. I had to disable generate overlap events on my static mesh on my character blueprint.

1 Like

saved my day man…