void OnTriggerStay(Collider other) { if (other.tag == "Boat") { ScannedRobotEvent1 scannedRobotEvent1 = new ScannedRobotEvent1(); scannedRobotEvent1.Distance = Vector3.Distance(transform.position, other.transform.position); scannedRobotEvent1.Name = other.name; ai.OnScannedRobot1(scannedRobotEvent1); } }