// Use this for initialization void Awake() { playerTransform = GameObject.FindGameObjectWithTag("Player").transform; waypointControllerScript = GameObject.FindGameObjectWithTag("WaypointController").GetComponent <WaypointController>(); closestWaypoint = waypointControllerScript.FindClosestWaypoint(transform); if (decoy == false) { targetTransform = playerTransform; } }
public float minSpeed, maxSpeed; //minSpeed - higher number but low speed(eg. 3), maxSpeed - lower number max speed (eg.1) // Use this for initialization void Start() { playerTransform = GameObject.FindGameObjectWithTag("Player").transform; waypointControllerScript = GameObject.FindGameObjectWithTag("WaypointController").GetComponent <WaypointController>(); closestWaypoint = waypointControllerScript.FindClosestWaypoint(transform); }