R
R
RandomProgrammer2021-12-04 12:04:55
Unity
RandomProgrammer, 2021-12-04 12:04:55

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

2 answer(s)
G
GFX Data, 2021-12-04
@ShockWave2048

at startup these values ​​will be visible

N
Neur0Surge0n, 2021-12-05
@Neur0Surge0n

[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 question

Ask a Question

731 491 924 answers to any question