public void addAdditionalUpdateFrameBehavior(Boids boidsController)
{
if (wantsToLand) {
RaycastHit hit;
Vector3 origin = new Vector3(transform.position.x,
rayDistance,
transform.position.z);
bool rayHit = Physics.Raycast(origin,
new Vector3(0, -1, 0),
out hit,
rayDistance);//, landLayerMask);;
bool foundValidLandingPoint = false;
if (rayHit) {
if (hit.point.y > boidsController.desiredLandingRange.x && hit.point.y < boidsController.desiredLandingRange.y) {
foundValidLandingPoint = true;
print("FOUND VALID LANDING POINT!!!! " + hit.transform);
}
}
if (!isLanding && !isLanded && foundValidLandingPoint) {
print("Landing Point found");
landingPoint = hit.point;
isLanding = true;
fixYValue = false;
}/* else if (isLanding) {
if (hit.distance < 0.2f) {
isLanded = true;
}
} // take off...*/
}
}