- Home /
Question by
Bubinga_Studios · Jul 10, 2018 at 04:02 AM ·
transformarrayarraysadd
Help adding transform to end of array
Type UnityEngine.Transform[] does not contain a definition for Add and no extension method Add of type UnityEngine.Transform[] could be found. Are you missing an assembly reference?
Need help to add to the end of transform array in unity. Please help! TransformArray.Add(Transform2);
Comment
Answer by donutLaserDev · Jul 10, 2018 at 06:43 AM
Don't use an array. Use a List: https://msdn.microsoft.com/en-us/library/6sh2ey19(v=vs.110).aspx
To create a list, type:
List<Transform> transformList = new List<Transform> ();
To add to a list: type:
transformList.Add (anotherTransform);