Search Unity

Transform Relay Lenght

Discussion in 'Scripting' started by DeKoett, Mar 22, 2019.

  1. DeKoett

    DeKoett

    Joined:
    Feb 25, 2019
    Posts:
    2
    Hi i want to build a Tower Defense Game and i use Waypoints and want that the Enemy move from one to the next, but if i want to us a Transform Relay with a for function then is here a Error and there stands "Transform[] does not contain a definition for Lengh..."
    Code (CSharp):
    1.  public static Transform[] points;
    2.  
    3. void Awake()
    4. {
    5.       points = new Transform[transform.childCount];
    6.       for (int i = 0; i < points.Lenght; i++)
    7.       {
    8.              points[i] = transform.GetChild(i);
    9.       }
    10. }
    11.  
    Thanks for help

    sorry for my bad english i am 13 and from Germany
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    it looks like you wrote Lenght and it should be Length (switch the the 't' and the 'h').
     
  3. DeKoett

    DeKoett

    Joined:
    Feb 25, 2019
    Posts:
    2
    yes this was the issue. Sorry tust it was so idiot