I have a parent with a trigger collider and it’s child, also with a trigger collider. I have this script on the parent:
void OnTriggerEnter2D (Collider2D c) {
switch (c.tag) {
case "object":
crash ();
break;
}
}
However, when the child touches an “object”, crash()
is called. I only want to call it if it’s the parent itself colliding.
I still want the child to collide with “object” (and call a different function), but I only want to call crash
if it’s the parent colliding, so layers aren’t an option as far as I know.