- Home /
Using arrays in inspector variables
Is it possible? With Javascript?
On 2D Platform Game Tutorial I want to make multi targets to the platform mover script rather than just one, so I figured "why not an open array?", thus this question.
Answer by Eric5h5 · Feb 25, 2010 at 10:26 PM
You can use arrays like Transform[] and GameObject[], but I don't think there's any easy way to use Array().
var targets : Transform[];
This actually solves my question, though it doesn't answer the generic question on the title.
I was wondering this too -- I tried adding an array member, but it was only showing Size 0, until I realized that the size was edit-able, duh!
Answer by Kethis Celebes · Feb 25, 2010 at 10:23 PM
I believe what you want can be done with UnityEditor by customizing the inspector pane, but I am posting from my mobile and can not provide you with code atm.
http://unity3d.com/support/documentation/Components/gui-ExtendingEditor.html
I won't look into this now, but this is actually a better more generic way of answering the question, if it works.
Your answer
![](https://koobas.hobune.stream/wayback/20220612084750im_/https://answers.unity.com/themes/thub/images/avi.jpg)