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;
}
}
}