ontriggerenter triggering at the wrong time
I have a game in which i want my player to jump from one platform to the other. On my platform I have a box collider.
when i would try to jump sometimes my player would hit the side of the collider and start grinding up against it until it would slip down and finally trigger the death condition, so to prevent this i put a trigger collider next to my platform. i also put the trigger collider slightly below the box collider so that in the case my player jumps on the edge, he doesnt activate both.
if the trigger triggers i play the death function, otherwise i assume the player has made a solid jump and go on with the other game logic.
however i notice that sometimes when the player land on the edge of my platform it enters on collision as well as the on trigger event. Even though i notice in my scene view that the player collider has not entered the trigger collider before the platform. infact as i said the trigger collider is below the platform.
I have tried adding raycast to the mix but im still getting this bug, but even despite the raycasts i dont understand why ontriggerenter is triggering when the player hasnt entered the trigger?
I did consider the fact that the player collider might push into the platform collider since the player is falling with some speed but i thought it would show up in the scene view but thats not the case.
this is a side on view of my 3d environment. It is not the exact depiction but to simplify it for you guys. My player is jumping from one platform to the other, both of these platforms are for all means and purposes 3d cubes with box colliders. In between the two platforms but at a slightly lower level I have a trigger collider.
when my player hits the trigger collider its game over. my question is sometimes my player will land on the edge of the box collider as in the sketch but for some reason it will trigger the gameover trigger collider when there is no penetration of my player collider with the trigger collider, as you can see there is plenty of space in between them they arent even touching.
To sum up - my ontriggerenter is running when there is no visible contact between my player and the trigger collider, question is why?
ignore the draw ray, as you can see, my player collider is firmly on top of the platform box collider, and yet ontriggerenter for the collider next to and below the platform is triggered and my player goes into death animation. I cant be more specific then this, its up to you guys to help me out now and explain why this is happening. my player is far away from the triggercollider they arent touching.