Array error

Hi everybody.

I have missed something, I get 3 dots below my array names. The C# auto fix suggest to change string to readonly string. Does any one get the same issue and how was this fixed?

Array%20error

Hi Nico,

This is not an error. It’s a suggestion for the code style. Ignore it or check Tools > Options > Text Editor > C# > Code Style > Formatting. I assume you have to disable “Make private fields readonly when possible”.


See also:

Thank you I will try it, my code runs fine but in Unity I can no longer see on what screen I am on when the Terminal is running.

Hi Nina,

I’m not able to change that setting, it is greyed out.
Any ideas?

Hi Nina,

I have manged to set the “Make private fields readonly when possible” but it made no difference.
Because that formatting error is before any of my declarations I can not see on what screen I am when the game is playing.

Click on the menu icon in the top right corner of your Inspector and select “Debug”. Then you should hopefully be able to see the missing field again.

readonly is fine for the arrays. It just tells the program that nothing is allowed change the fields. Do not do that with the other variables, though, because they do get changed during runtime.


See also:

Thank you very much for your help.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms