I seem to be encountering an odd error. I feel like I’m overlooking something but a fresh perspective would be nice.
I have a 2D array of objects of a class. However, if I try to make it public, I get the following error message:
error CS1525: Unexpected symbol ‘public’
And here is my array definition:
public MyClass[,] theArray = new MyClass[10,10];
This works perfectly fine without the “public” part, but I need it to be public so I can reference it in other functions and scripts. Any ideas?