void Start ()
	{
        currentState = aiStates.OBSTACLE_AVOID;

		laneSystem = GameObject.FindGameObjectWithTag ("LaneSystem").GetComponent<LaneSystem> ();

		turnLeft = turnRight = false;
		goForward = true;
		rb = GetComponent<Rigidbody> ();

//		InputController.Instance.SetAI (true);
		aiController = GetComponent<AIInputController> ();
		prevPosition = transform.position;
		laneManager = GetComponent<AILaneManager> ();
		offTrack = false;
	}
	void Start ()
	{
		blackboard = GameObject.FindGameObjectWithTag ("Blackboard").GetComponent<RacerBlackboard> ();
		laneSystem = GameObject.FindGameObjectWithTag ("LaneSystem").GetComponent<LaneSystem> ();

		racerId = countId++;

		prevAheadNode = currentWaypoint;
		targetAheadNode = nextWaypoint;

		//I added this to know how many waypoints we have  on the track using the LaneManager class only. to use it to reset the car.
		//Any better way to do it please, tell (david)
		totalWayPoints = laneSystem.waypoints.Count;

		maxChangeDistance = laneSystem.trackWidth * 2;

	}
	void Start ()
	{
		laneSystem = GameObject.FindGameObjectWithTag ("LaneSystem").GetComponent<LaneSystem> ();
	}