Collision Glitch - HELP!

I’ve been having a bug/glitch regarding collisions for quite a while now. Basically, a player has to land on the Ring. The Top part of the ring (“SafeRing”) is where the player lands and survives. The Bottom part (“MainRing”) causes the player to die on collision.

The Problem? On Unity Editor, 40% of the time, when the player lands on the SafeRing, the Editor detects it a collision with SafeRing and also MainRing (a split second later). This is probably because the player is falling through the SafeRing and thus hitting the MainRing.

The Weirdness? Other than the bug itself, the weird part is that the bug does NOT EXIST on Mac builds, and it occurs 100% of the time on iOS. To summarize:
Mac: 0%
iOS: 100%
Unity Editor: 40%

My Guess? Maybe because Concave Mesh Colliders are unreliable, the player is able to fall through it and hit the MainRing to die? BUT THAT DOESN"T MAKE SENSE! Why? Because when I remove the MeshCollider and use a bunch of BoxColliders instead, the problem still occurs!

I’d appreciate any help, as I’ve been tearing out my hair trying to solve this seemingly-simple problem over the last couple of days.

PICTURES:

[PLAYER GAMEOBJECT:]

[Collision Code, attached to Player Object ^ ]


[MainRing - the part of “Ring” that kills the player if the player touches it]

[RingSafe - the part of the Ring that the player lands on to gain a point, and not die] - except the player somehow sometimes touches the MainRing anyways… (which is the glitch)

[The Ring - the blue is “RingSafe”, the red is “MainRing”] - The player is supposed to land on RingSafe, but sometimes the unity editor impossibly detects a collision with MainRing and kills the player.
3069724--230829--Screen Shot 2017-05-14 at 7.22.36 PM.png

I see two things.

  1. code changes. in the OnCollitionenter(), swapped them. check for the death tag after you checked for the safe tag

  2. modeling. it looks like you have the save mesh for both safe and death. cube.001. this tells me that you are using the same model and there for the colliders are overlapping. if you did the modeling. you just need to brake up the model into each peace.

when you did this. did you resize the box colliders so that they where under the safe ring? or did you leave it at 1x1x1

For #2: The two rings you see (blue/red) in that photo are different gameobjects. Look at the inspector in each photo for each gameobject .

In other words, that ring is NOT one model.

Yep of course

#1 made it occur less often, but it still occurs in Editor…

You can change the player rigidbody collision into continuous or continuous dynamic, but that wont guarantee 100% precision
Or you can check/predict where the player will land using Raycast family(SphereCast, CapsuleCast etc)
[EDIT]
Check the last post from jason_nyan for explanation on discreet vs continuous collision check

Does Raycast work 100%?

AFAIK, yes… At least depends on how you use them, but in my case they work all the time.

If you have time, could you give me a quick walk through of how I would use Raycast to do this? (I’ve never used Raycasts before)

it should be something like…
Note: this code havent been tested, only by using this as reference

void Update()
{
   ...
  //You might want to check ONLY if the player is airborne(not touching the ground)
  RaycastHit hitInfo;
   if(Physics.BoxCast(transform.position, GetComponent<Collider>().bounds.extents, GetComponent<Rigidbody> ().velocity, out hitInfo, transform.rotation, GetComponent<Rigidbody>().velocity.magnitude * 2)
  {
     if(hitInfo.transform.CompareTag("death")
     {
        //do death here
     }else
    if(hitInfo.transform.CompareTag("Safe")
    {
        //do safe here
    }
    //optional, put player at impact point assuming player origin is at the bottom(else, you need to add the offset to the hitInfo.point
    transform.position = hitInfo.point;// + offset if origin is not at the bottom
  }

}