Im just starting to learn how to use arrays and classes and im wondering how i can get this to work can someone help me? Thanks!
TestArray
var people = 10;
var personArray : myPerson [];
class myPerson
{
}
function Start ()
{
personArray = new myPerson [people];
}
AddToArray
var testInventoryObject : Transform;
class myPerson
{
var myName = "Brandon";
}
function Update ()
{
if (Input.GetKeyDown("e"))
{
testInventoryObject.GetComponent(TestArray).personArray[0] = myPerson;
}
}
Can someone tell me how i can make this work?