27-11-2020, 02:53 PM
(27-11-2020, 02:38 PM)JoseCarlos S Wrote: // this one is an actual collision:
if (contact.distance < 0.01)
{
ObiColliderBase collider = world.colliderHandles[contact.other].owner;
if (collider != null)
{
ObiColliderBase collider = ObiColliderWorld.GetInstance().colliderHandles[contact.other].owner;
GameObject.Destroy(collider.gameObject); // do something with the collider.
}
}
This won't compile because you're defining "collider" twice. Fixing it is left as an exercise to the reader
