Answer the question
In order to leave comments, you need to log in
Array elements from code not showing up in inspector?
I made an array in the code, it shows up in the inspector. But when I add elements to the array in the inspector in the array initializer, it is still empty.
public int[] myArray = new int[] { 1, 2, 3};
Answer the question
In order to leave comments, you need to log in
[SerializeField] int[] myArray = new int[] { 1, 2, 3}; I didn’t quite understand the question, but after these changes, the elements of the array, like the array itself, should be visible in the inspector.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question