how to solve this? Operator '<' cannot be used with a left hand side of type 'Object'....

I’m new here in unity… and i’m trying to develop a game AI pathfinding algo… and i’m stuck debugging this error:
EnemyMovementScript.js(34,88): BCE0051: Operator ‘<’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘float’. it works fine on PC MAC, but on android that error appears… can someone help me here??

EnemyMovementScript:

    var currentCell : GameObject;
    var playerCar : PlayerCar;
    var playerTransform : Transform;
    var playerCell : GameObject;
    var goalDoor : GameObject;
    var shortestPathSoFar : float;
    @HideInInspector
    var waitToStart : int = 5;
    var currentMoveSpeed : float = 5;
   
     
    var randomizedCourse : boolean = false;
    var randomizeCourseVector : Vector3;
    var calculatedNewRandomizeCourseVector : boolean;
     
    function Awake ()
    {
        shortestPathSoFar = Mathf.Infinity;
        playerCar = GameObject.FindWithTag("Player").GetComponent(PlayerCar);
        playerTransform = GameObject.FindWithTag("Player").transform;
        waitToStart = 5;
        randomizeCourseVector = transform.position;
    }
     
    function Update ()
    {
        if (waitToStart <= 0)
        {
            playerCell = playerCar.currentCell;
            for (var doorCheckingNow : GameObject in currentCell.GetComponent(AIpathCellScript).doors)
            {
                for (var i : int = 0; i <= doorCheckingNow.GetComponent(AIpathDoorScript).cells.length - 1; i++)
                {
                    if (doorCheckingNow.GetComponent(AIpathDoorScript).cells *== playerCell)*

if (doorCheckingNow.GetComponent(AIpathDoorScript).doorsToCells _< shortestPathSoFar)
{
goalDoor = doorCheckingNow;
shortestPathSoFar = doorCheckingNow.GetComponent(AIpathDoorScript).doorsToCells*;*
}
}
}
shortestPathSoFar = Mathf.Infinity;
}
waitToStart -= 1;_

if (!calculatedNewRandomizeCourseVector)
{
randomizeCourseVector = FindRandomSpotInCurrentCell();
calculatedNewRandomizeCourseVector = true;
}

if (goalDoor)
if (!goalDoor.GetComponent(AIpathDoorScript).doorOpen)
goalDoor = null;

if (currentCell != playerCell || playerCell == null)
{
if (randomizedCourse)
transform.position += (goalDoor.transform.position - transform.position).normalized * currentMoveSpeed * Time.deltaTime;
if (!randomizedCourse)
{
transform.position += (randomizeCourseVector - transform.position).normalized * currentMoveSpeed * Time.deltaTime;
if (Vector3.Distance(transform.position, randomizeCourseVector) < transform.localScale.x)
{
if (goalDoor)
randomizedCourse = true;
if (goalDoor == null)
calculatedNewRandomizeCourseVector = false;
}
}
}

if (playerCell == currentCell)
transform.position += (playerTransform.position - transform.position).normalized * currentMoveSpeed * Time.deltaTime;
}

function OnTriggerEnter (hitTrigger : Collider)
{
if (hitTrigger.tag == “AIpathCell”)
{
currentCell = hitTrigger.gameObject;
randomizedCourse = false;
calculatedNewRandomizeCourseVector = false;
}
}

function FindRandomSpotInCurrentCell ()
{
return currentCell.transform.position + (currentCell.transform.rotation * Vector3(Random.Range(currentCell.transform.localScale.x * -0.5,currentCell.transform.localScale.x * 0.5),0,Random.Range(currentCell.transform.localScale.z * -0.5,currentCell.transform.localScale.z * 0.5)));
}

You need to cast the GetComponent() results or use the generic form:

doorCheckingNow.GetComponent<AIpathDoorScript>().doorsToCells

where should i put it? sorry man. but i’m really a noob… :frowning:

thanks man… but it still did not work… :frowning: