I have a rigidbody box which moves around, and I have two “feeler” boxes in front of it to detect collisions - just like an insect’s antenna. The feelers are children of the main box, and IsTrigger is activated on each one. The feelers are named “LeftFeeler” and “RightFeeler”.
When one of the feelers hits a wall, I want it to rotate the box away(EDIT: but the feelers themselves are ONLY triggers, not physical objects). The problem is that I can’t determine which feeler is colliding, because I don’t know how to access them.
I put the same script on both feelers, and I tried this:
void OnTriggerEnter(){
Debug.Log (this.gameObject.name);
}
But that just gives me the name of the parent box. How do I access the child that had the collision?