So I made a public static variable called “careerActive” I learned earlier that changing it to false doesn’t set it to false in the other script. So I needed to make it static. (that makes it work in both right?) the problem is on line 25 in my other script. Visual Studio tells me “Member ‘CareerButton.careerActive’ cannot be accessed with an instance reference; qualify it with a type name instead” What have I done wrong?
Static variables and methods can not be accessed from an instance of a class, you have to access them from the class itself.
So you can not access your static variable careerActive through the instance careerButton and instead must access it through the class CareerButton.
In short change careerButton.careerActive to CareerButton.careerActive
Don’t forget to upvote my answer… no one seems to upvote on here…