Initializeing const variables in the GUI

Hey, I was wondering if there is a way to change or initialize a const variable in the unity GUI. I’m more familiar with C++ so I know you use a member initializer list to do it there… but I’m not familiar with how to do it in C#. If anybody could help me with this I would greatly appreciate it.

Hello,

what are you trying to achieve?
please give us more information so we can help you out and tell you the best way to do things :slight_smile:

There isn’t any way to initialise constants from the editor, unfortunately. The reason is that an instance of your object is already created and active in Unity in the editor - since the code is already compiled by this point, you can’t change the values of any constants you’ve declared. There is no way to change class variables in the editor either, so I’m afraid you can’t use them as an alternative.