Search Unity

[SOLVED] How to change size on Array?

Discussion in 'Scripting' started by DarkSoul, May 17, 2010.

  1. DarkSoul

    DarkSoul

    Joined:
    Dec 24, 2009
    Posts:
    37
    Hello.
    I want to change the size of Transform[], but I don't let me. How do you change you?
    I tried with: Transform.Length = 10; Transform.GetLength(10) but I return this error: Array Index is out of range

    EDIT: I have solved:
    Code (csharp):
    1. MyTransform = new Transform[10];
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    just keep in mind that this does not change anything.
    it kills the old and creates an all new one.