Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Transform is not a member of object Error, When set to IOS

Discussion in 'Scripting' started by RussellT, Jan 28, 2016.

  1. RussellT

    RussellT

    Joined:
    Feb 1, 2015
    Posts:
    18
    Hi All,

    I get this "Transform is not a member of object Error" when trying to access a gameObject in an Array. All this works fine when set to PC mode....Here's the code.

    Code (JavaScript):
    1.  
    2. var tempSelection : GameObject;
    3. var highLightArray = new Array ();
    4.  
    5. function Start ()
    6. {
    7.     highLightArray.Push(tempSelection);
    8.     print(highLightArray[0].transform);
    9. }
    10.  
    The Array needs to be able to resize all the time, I push in various groups of objects.

    Should I be using Lists? Which is only in C (I think)

    Any help really Appreciated!
    Cheers,
    Rusty
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    You need to type the array. Or use C#
     
  3. RussellT

    RussellT

    Joined:
    Feb 1, 2015
    Posts:
    18
    Hey, Thanks for the help!

    Could you explain what you mean by typing it out, if I do that I won't be able to add and remove objects on the fly though right?

    In C I would be using lists?