Im trying to check, from and external script in a parent, when a trigger collider leaves a surface. I do this with a boolean, but for some reason it always returns false (even when manually set to true) What am I missing?
Parent Script:
GameObject bottom = GameObject.FindWithTag("Bottom1");
VehicleBottom other = bottom.GetComponent<VehicleBottom>();
if (bottom == null)
Debug.Log("Vehicle bottom is not found");
if (other.touchingGround == false)
Debug.Log ("Not Touching Ground");
if (other.touchingGround == true)
Debug.Log ("Touching Ground");
Child Script:
public bool touchingGround = true;
void OnTriggerExit(Collider other){
touchingGround = false;
Debug.Log("Vehicle has lost contact with ground");
}