Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  multiple colliders detection problem
#1
Pregunta 
Greetings,

I have two colliders that are nested. Each of these has its own tag. When the colliders touch the rope, only the outermost, that is, the first contact with the rope, is seen. How do I solve this?


Quote:void Solver_OnCollision(object sender, ObiSolver.ObiCollisionEventArgs e)
{
    var world = ObiColliderWorld.GetInstance();

    // just iterate over all contacts in the current frame:
    foreach (Oni.Contact contact in e.contacts)
    {
        // if this one is an actual collision:

        ObiColliderBase col = world.colliderHandles[contact.bodyB].owner;
        if (col != null)
        {
            if (col.CompareTag("saw"))
                TearRope(col, contact);
            else if (col.CompareTag("nearMiss"))
            {
                DamageRope(col, contact);
            }

        }
    }
}
Reply


Messages In This Thread
multiple colliders detection problem - by greyhawk - 22-11-2021, 01:51 PM