trying to implement simple random pathfinding AI... tho getting EXT_FighterAI.cs(41,89): error CS0019: Operator `>' cannot be applied to operands of type `UnityEngine.Vector3' and `int'

hi gang trying to implement basic Pathfinding for my space game by finding random waypoints and moving to them then getting another waypointbut im getting:
EXT_FighterAI.cs(41,89): error CS0019: Operator >' cannot be applied to operands of type UnityEngine.Vector3’ and `int’

dont seem to get it…

using UnityEngine;
using System.Collections;

public class EXT_FighterAI : MonoBehaviour {


	public GameObject nextWaypoint;

	public Transform selectedTarget;
	public Transform selectedWaypoint;
	public Vector3 waypointDistance;


	public float maxSpeed;
	public float currentSpeed;
	public float turnSpeed;
	public float shipHealh = 100;
	public float AIstance = 1;

//-----------------------------------------------------------------------------------------------------------
	// Use this for initialization
	void Start () {
	
	}
//-----------------------------------------------------------------------------------------------------------
	// Update is called once per frame
	void FixedUpdate () {
		
		// set patrolling AI:
		if (AIstance == 1) {
			patrolingAI ();
		}


	}	

//-----------------------------------------------------------------------------------------------------------
	void patrolingAI ()	{

		//Find and assign a  waypoint:
		nextWaypoint = GameObject.FindGameObjectsWithTag("EXT_AI_Waypoint") && (waypointDistance > 100);

		//Look at Assigned Waypoint and get its distance:
		Quaternion WantedRotation = Quaternion.LookRotation (nextWaypoint.transform.position - nextWaypoint.transform.position, nextWaypoint.transform.up);
		waypointDistance = Vector3.Distance(nextWaypoint.transform.position, transform.position); 

		 //when arive at waypoint, assign new waypoint that is greater distance then 100, so cannot assign the same waypoint.
		if(waypointDistance < 10){
			nextWaypoint = GameObject.FindGameObjectsWithTag("EXT_AI_Waypoint") && (waypointDistance > 100); //only choose if distance is > then 100.
		}

	}
//-----------------------------------------------------------------------------------------------------------

}

Vector3.Distance returns a float, not a Vector3.

So, as @saschandroid said in his comment, you need to change the type of waypointDistance to a float.

float waypointDistance;

Also, you should change those hard-coded values of 10 and 100 to some variable threshold values

float waypointThreshold = 10f;
float nextWaypointDistanceLimit = 100f;

Then your if statements will look much cleaner

if(waypointDistance < waypointThreshold){
     nextWaypoint = GameObject.FindGameObjectsWithTag("EXT_AI_Waypoint") && 
                   (waypointDistance > nextWaypointDistanceLimit);
}

While we’re here, this logic is all sorts of flawed. For one, you cannot compare a GameObject and a boolean value.

GameObject.FindGameObjectsWithTag("EXT_AI_Waypoint") &&
(waypointDistance > nextWaypointDistanceLimit); //Shouldn't even compile

And, your if-statement is only evaluated if waypointDistance is < 10, and then you’re checking to see if waypointDistance is > 100, which will NEVER be true.

What I think you’re going for is this.

if(waypointDistance < waypointThreshold){
  GameObject[] potentialNewWaypoints = GameObject.FindGameObjectsWithTag("EXT_AI_Waypoint");
  foreach (GameObject waypoint in potentialNewWaypoints){
    Vector3 waypointPosition = waypoint.transform.position;
    float distanceToNewWaypoint = Vector3.Distance(transform.position, waypointPosition);
    if (distanceToNewWaypoint > nextWaypointDistanceLimit){
      nextWaypoint = waypoint;
      break; // Maybe you don't want to break, I don't know
    }
  }
}

I would take the above code and refactor it into its own method called FindNewWaypoint()

private GameObject FindNewWaypoint(){
    GameObject newWaypoint = null;
    GameObject[] potentialNewWaypoints = GameObject.FindGameObjectsWithTag("EXT_AI_Waypoint");
    foreach (GameObject potentialNewWaypoint in potentialNewWaypoints){
      Vector3 waypointPosition = potentialNewWaypoint.transform.position;
      float distanceToNewWaypoint = Vector3.Distance(transform.position, waypointPosition);
      if (distanceToNewWaypoint > nextWaypointDistanceLimit){
        newWaypoint = potentialNewWaypoint ; 
        // Maybe you want to return multiple, if so, refactor as needed.
        break;
      }          
    }
    return newWaypoint; // I don't like potentially returning null, but can't think of anything right now.
}

Then you would have

void patrolingAI(){

    Quaternion WantedRotation = 
      Quaternion.LookRotation (nextWaypoint.transform.position - nextWaypoint.transform.position,
         nextWaypoint.transform.up);         
    waypointDistance = Vector3.Distance(nextWaypoint.transform.position, transform.position); 

    if (waypointDistance < waypointThreshold){
      nextWaypoint = FindNewWaypoint();
    }
}

And while we’re at it, why not refactor the rotation code to its own method as well.

private void RotateToFaceWaypoint(){
 transform.rotation = Quaternion.LookRotation (nextWaypoint.transform.position - nextWaypoint.transform.position, nextWaypoint.transform.up);
  // Took out the distance calculation, otherwise you have one method doing two different things
}

Then your finished method looks like

void patrolingAI()
{
   RotateToFaceWaypoint();
   waypointDistance = Vector3.Distance(nextWaypoint.transform.position, transform.position); 
   if (waypointDistance < waypointThreshold){
    nextWaypoint= FindNewWaypoint();
   }

   if (nextWaypoint == null){
      // Should probably stop or do something else as there are no new waypoints to go to.
   }
}

Much cleaner, and easier to read all around!!!
Good work so far, just thought it could use some cleanup.