22-11-2021, 01:51 PM
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?
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);
}
}
}
}