- Home /
Question by
Dubious-Drewski · Aug 09, 2013 at 03:03 AM ·
variableaccesspublicsharing
Can I make variables visible to other scripts without making them visible in the Inspector?
That's about it.
I sometimes need for some variables to be sharable between scripts, so I make them public, but this then makes them visible in the inspector. I have no use for accessing them in the Inspector panel; they're just for internal use, so it clutters things up. Is there a way to change this behaviour?
Comment
Best Answer
Answer by clunk47 · Aug 09, 2013 at 03:17 AM
Certainly. Here's an example.
[HideInInspector]
public int testInt = 0;
Ah, thank you. I couldn't find that info myself for some reason. I like that I can keep it to one line:
[HideInInspector] public float nearHeat = 0f;
That's handy.