Search Unity

Public variable that does not appear in the inspector?

Discussion in 'Scripting' started by Marscaleb, Aug 20, 2014.

  1. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    I know I've seen this before, but I totally don't recall how to do this, and I don't see the answer in the documentation.

    How do I declare a public variable but set it so it does NOT show up in the inspector?

    In C#.
     
  2. Fyko-chan

    Fyko-chan

    Joined:
    Sep 29, 2012
    Posts:
    76
  3. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Code (CSharp):
    1. [HideInInspector]
    2. public int score;