My public variables wont show up in the inspector.

My public variables won’t work. I’ve been trying to make a game but my public variables are refusing to work. At the top of unity, it says my version is 2019.3.15f1 Person, (Not sure if this is the most reliable way of getting it and, 2019, yes I know) I’ve even tried copying tutorials or importing scripts made by developers. Nothing works, I made an example script and an entirely different project and it still won’t show up in the inspector. Is it my version or my code? Here’s the example code since the scripts in my game are riddled with compiler errors.

public class Example : MonoBehavior
{

   public float ExampleNumber;
   public float MinusNumber;

   void Update()
{
       if (Input.GetMouseButtonDown(1)
      {
      ExampleNumber -= MinusNumber;
      }
   }
}

You’ve answered your own question. The reason your public variables aren’t showing up is because you have compiler errors. The inspector can’t serialize scripts that can’t compile.

Sorry handtyped the code area, might not be picture perfect to a real script but it resembles what it looks like.