OnComponentEventOverLap Not Firing Randomly
Hi Everyone, I have set up a endless runner type of game, and I have set up a End trigger and it will run a blueprint to make new floortile ahead. After adding more function and content in my game, I found out the floortile will randomly not spawn,I made sure all my box collision (EndTrigger) is placed properly and they have been hit. and I also tested in the game with the box collision not hidden in game and paused the game when the Floortiles are not spawning to check, I couldn't find the reason. Sometimes they works just fine, sometime they don't. I do have other object like coins and blocker, are they causing the problem? Is it a bug or is it something I might be not aware of?
FIXED: i made a extremely stupid mistake, I was making a new type of floortile and added a new element in my floortile array and I didn't finish the work during that time and left a NONE in my array, and that's what is causing the missing floortile!
Below are the screen shot of the endlesstrigger (the tall one between tiles). It's a paused game screenshot after the floor stopped spawning and my character fly out :(. Sometime i can keep running for 5 min nothing happened, and sometimes it happens in the first few tiles.
Great, so here we go :)
One problem that I have experienced with BeginOverlap is that it does not fire if the collision happens already when spawning in the actor or the colliding object. I guess you spawn a bunch of tiles ahead of the player, so I am not sure if there will be any case where you accidently/randomly spawn an collider on your actor. But just be aware of this.
Just a question about a simpler painless approach: Why do you bother with Colliders at all to spawn your tiles? You know the Location of the player and you know the Location of your last tile. If the difference between both locations is less than a certain limit, you can spawn the next tile :)
hope that helps :) Marooney
answered Jul 25 '16 at 01:54 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here