void OnWillRenderObject() { if (Camera.current == Camera.main) { Vector3 directionToObject = gameObject.transform.position - Camera.main.transform.position; if (Physics.Raycast(Camera.main.transform.position, directionToObject, out hit)) { if (hit.collider.gameObject.tag == "SpecialArea" && closeEnough == true && genObsvCalled == false) { genObsvCalled = true; //print("lookin at special area"); myObsv.GenerateObservation(myDescription); } } } }