On Begin Overlap firing twice


This is clearly not normal, My OnBeginOverlap Events are firing twice. My character is falling down to on the platform, and as he does he enters a collisoin box with OnBeginOverlap set to fire a score increasing function. And this OnBeginOverlap is clearly fired twice by UE4. Using DoOnce in the function does not help, as it gets called twice by the Overlap Event…
The funny thing is that I am absolutely sure it did work just fine, I have just found out that it’s broken, and have no idea why. The only thing I was changing in the project were character animations.

Most likely it is not the problem, but don’t you use animations with root motion? Theoretically the animation could move the capsule up and down a bit, so there would be two collision begin.

I would also check if OnEndCollision is firing twice as well or not.

Yes the End Overlap also fires twice, I have just checked it. And during the fall the animation is just a still pose for falling, so no, this can’t be it.

Are you sure your character doesn’t have 2 collision meshes on them? Is there only a capsule or do you have more components in there? Maybe the character skelMesh and the Capsule collide?.. I am creating a side scroller game too and it works fine for me, my character has no collision , only the Capsule does that.

You could also make a work around, you could make a bool variable so that after the first time it is overlapped you’d make it so that second overlap doesn’t do anything in your event graph.

1 Like

Thanks, that was it. I must have missed the double scoring when I added my separate touch hit box. My bad. Now the problem is how to have separate capsule for overlaps with side walls, and separate (larger) collision box as a hit box for touch events. And of course keep the Begin Overlap to fire just once.
The workaround with bools is of course possible, but that would be a little mess. I have ten levels in a segment with segments recreating as the player progresses, so I would need to constantly pass the values from one level to another. I wolud prefer to avoid this kind of solution if a proper components setup is possible.

Thanks for the Answer, I was very confused. And now, problem solved.Thanks.

I’m adding this for anyone with the same issue (and for me because I know this will come up again).
Check the overlap events on the actor being overlapped by the player. in my case it was a simple cube. Set the Collision Overlap to Pawn and the rest ignore. Hope this helps someone.

1 Like