GUI button not working?

I have two scripts. A script to make a button when the player is wishing a certain distance,

public class Distance : MonoBehaviour {

	public float maxDist = 3;
	public Transform t;
	public string text1;

	// Use this for initialization
	void Start () 
	{
	
	}
	
	// Update is called once per frame
	void Update () 
	{

	}

	void OnGUI()
	{
		float dist = Vector3.Distance (t.position, this.transform.position);

		if (dist < maxDist) 
		{
			GUI.Box (new Rect(10, 10, 100, 90), text1);

			if(GUI.Button (new Rect(20, 40, 80, 20), "Yes"))
			{
				Quests.isQuestOne = true;
			}
		}
	}
}

and a script that prints in the debug log when isQuestOne = true.

public class Quests : MonoBehaviour {

	public static bool isQuestOne = false;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update ()
	{

	}
	
	void QuestOne()
	{
		if (isQuestOne == true) 
		{
			Debug.Log ("Yay");
		}
	}
}

When I click the button however, nothing seems to be happening. What am I doing wrong, and how can I fix it?

I’m not completely if this will help, but i noticed that your void QuestOne() isn’t called from anywhere try adding it to a method that is being called.

//although i wouldn't recommend using Update all the time for things like this
void Update()
{
QuestOne();
}