Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Invalid expression term '<'

Discussion in 'Getting Started' started by Lojtra12, Sep 4, 2019.

  1. Lojtra12

    Lojtra12

    Joined:
    May 4, 2017
    Posts:
    36
    I am trying to make plane detection, and in code it says this:
    Assets\HelloAR\Scripts\ARController.cs(34,25): error CS1525: Invalid expression term '<'

    // Instantiate a Grid for each DetectedPlane in m_NewDetectedPlanes
    for (int i = 0; < m_NewDetectedPlanes.Count; ++i)

    See photo attached … what could be wrong with it, thanks
     

    Attached Files:

  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,191
    Well, it's nonsensical syntax as it is. The middle term of your for loop needs to be a Boolean expression, but
    <
    is a boolean operator; it can't start an expression. Probably you meant
    i < m_NewDetectedPlanes.Count
    .
     
  3. Lojtra12

    Lojtra12

    Joined:
    May 4, 2017
    Posts:
    36
    oh, yes of course, I just did not see that :) thank you
     
    JoeStrout likes this.