Chapter 3: Components - public variable names in Unity UI?

Question:
In Chapter 3: Components, where scripting is introduced, C# code includes public variable declarations for “moveSpeed”, which then becomes visible in the Unity editor UI as “Move Speed”. Where was “Move Speed” ever specified as the text label that shows up in the UI? Same question applies to how “followTarget” becomes exposed in the Unity UI as “Follow Target”?

Thanks in advance.

Maybe I can answer my own question:

Hi @gordonh,

Yes, you are correct! That’s the Unity editor doing the work. It essentially breaks the variable into two words and capitalizes them for you. You can also create private private variables and serialize them into the editor, but that’s beyond the point :slight_smile:

This topic was automatically closed after 166 days. New replies are no longer allowed.