Protection Level error message

Hi!

I get this error message when trying to compile my scripts:
Assets/MainMenu.cs(53,36): error CS0122: `SceneFadeIn.EndScene()’ is inaccessible due to its protection level

Some of my code in MainMenu.cs:

public SceneFadeIn sceneFader;

........

void DoMainMenu(int windowID)
{
		if(GUILayout.Button("New Game"))
		{
			sceneFader.EndScene();
		}
}

Nothing should be wrong with this code since I have done similiar tasks before… So, how do I change the “protection level” of a script??

The function “EndScene” in the class “SceneFadeIn” is probably private or protected. It needs to be public if you like to access it from outside of the own class.

public SceneFadeIn: MonoBehaviour {
    public void EndScene()
    {
        //your code
    }
}