I’m trying to use a array its at the top of the script. It keeps telling me I need instance of the script to use the array doesnt it automatically have a instance for the script. I know in C++ in a class you have a instance of that class just wondering how it works with Javascript
this is the way I create my arrays
public var myArray: Array = new Array();
And if the advice above doesn’t help perhaps you can clarify what it is you’re trying to achieve, maybe even post some code. For example, are you defining your own class or writing a component script?
The problem i just found out was that i was trying use the array inside of a static function which Im guessing that I could not do so I just worked around it.