A public value that doesn't appear in the inspector?

Is there a way to make something (like a bool, string, int, Vector3, etc…) be accessible from other scripts like it’s public, but not show up in the inspector view?

Use the NonSerialized attribute.

You can also use @HideInInspector.

–Eric

Note that HideInInspector will still serialize values. You probably don’t need values to be serialized if you aren’t initializing them in an editor script or something.

um… that doesn’t seem to be working… probably because I forgot to mention I’m using C# :sweat_smile:

The c# equivalent is:

[HideInInspector]

(used directly before the hidden variable).

Cool! I didn’t know about this. Thanks, people!

Not working as in not compiling, or not working as in the variables are still showing up after compilation? If it’s not compiling, make sure you’re using the appropriate syntax for you language. There examples in the documentation page I linked.

Thanks, that worked =D