This is just declaring variables, very basic stuff…
When I write this code
public var word = new GameObject[wordLength];
I get these errors:
expecting ‘}’, found ‘public’
expecting EOF, found ‘}’
Can someone explain why this doesn’t work? And possibly give an alternative that does? Thanks in advance!
Delete the “public” from public var word = new GameObject[wordLength];
Public is an access modifier used in class definitions and with class members/methods. You don’t use it when declaring variables inside functions.
Also, I don’t know if it’s necessary since I always use c#, but it looks like the definition for the array should be var word : GameObject[] = new GameObject[wordLength];