OnComponentBeginOverlap triggered on object creation

I just completed the Endless Runner video tutorial series, and I have a bug with my item pickups. If you are familiar with the tutorial, the game starts by creating 10 floor tiles, randomly assigning either a rock or 5 coins to each floor tile. As you run to the next tile, a new one is created in the distance, and an old one is destroyed. And as you collect the coins, a total score is incremented on the HUD and the coins disappear.

My bug only occurs on the first 10 floor tiles that are created, not on any subsequent tiles. Every coin that is created on the first 10 tiles calls OnComponentBeginOverlap immediately after being constructed (I set breakpoints to confirm this). The mesh on the coin is set to OverlapOnlyPawn. Future tiles that get created do not have this same problem.

Has anyone else encountered this bug?

36899-coin+bug.png

Hi,
I was having the same issue, but with the blockers instead of the coins. I used print string to confirm that this is exactly what was happening. As soon as the game started the blockers generated the overlap event. I dont know if this is a bug or we are making a mistake somewhere but i do have a workaround.

I saw from the print string methods that it was in fact the RunCharacter that was triggering it but it was nowhere near the blockers.

I also saw that this happened only once per blockers the instant game started.
So i used a branch to make sure that nothing happens in the overlap event when the game started.

So when the world delta seconds is 0.0, meaning game just started, the overlap events still fire but they wont do anything.
Hope this help you.
If someone knows what exactly is happening, let us know please, Thank you.

Well, I’ve found out that the location of the Player Start Thingy is relevant to this issue somehow…
(I had the same issue until i moved the Player Start)

I did some testing and realized that When the Player Start is below Z150, The issue occurs…

Therefor raising the Player Start Above 150 (Z axis) “Solves” the issue

Yet I have still no clue as to why this is even happening in the first place, so if some dev can
clear this up, that’d be awesome!
:slight_smile:

Thanks

They(player and coins) must be created at the default location and moved to the desired location rigth after. Setting Player Start a bit higher works nice.