Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question 'List<ARRaycastHit>' does not contain a definition for 'Length'

Discussion in 'AR' started by sunnynoname, Oct 28, 2022.

  1. sunnynoname

    sunnynoname

    Joined:
    Jul 31, 2020
    Posts:
    3
    I'm going through the tutorial "Create an AR game using Unity's AR Foundation" and at step 4 I need to add code, after which I get an error.
    Link to add code in 4 step
    ReticleBehavior edit
    https://codelabs.developers.google.com/arcore-unity-ar-foundation?hl=ru#3:~:text=Edit the ReticleBehaviour

    // Error From console
    Assets\Starter Package\ReticleBehaviour.cs(47,10): error CS1061: 'List<ARRaycastHit>' does not contain a definition for 'Length' and no accessible extension method 'Length' accepting a first argument of type 'List<ARRaycastHit>' could be found (are you missing a using directive or an assembly reference?)


    please help me I can not understand what's the matter, because everything is as in the manual.
     
    Last edited: Oct 28, 2022
    trajamsmith likes this.
  2. ak4514768

    ak4514768

    Joined:
    Aug 18, 2021
    Posts:
    4
    Use .Count instead of .Length
     
  3. ak4514768

    ak4514768

    Joined:
    Aug 18, 2021
    Posts:
    4
    Were you able to find ForwardRendered? Also, does your app runs?
     
  4. nicolasandresknell

    nicolasandresknell

    Joined:
    Jul 14, 2021
    Posts:
    1
    hello, I have the same problem.

    tried to use .Count insted of .Lengh, but the reticle prefab does not move, it is static.

    also, I was able to find the ForwardRenderer and the app runs, it detects the planes and displays the reticle prefab but does not move it.
     
  5. ttayanlade

    ttayanlade

    Joined:
    Jan 26, 2023
    Posts:
    1
    Last edited: Mar 16, 2023