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.
}
}
//-----------------------------------------------------------------------------------------------------------
}