Get main can only be called in the main thread. Raycasting from cursor Please help.

I am attempting to write a script to check whether some cubes are being clicked on using raycasting but i am getting the error:

ArgumentException: get_main can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don’t use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
RNG…ctor ()

and i am not certain why as to my knowledge i have the code in the right place. Any help would be greatly appreciated.

my code:

public class RNG : MonoBehaviour
{

	public GUIText thisAnswer;
	public RandomiseAll reRoll;
	public int randomNumber;
	public RaycastHit hit = new RaycastHit ();
	public Camera mycam;

	//public int number = 0;
	int miniScore = 0;
	int CorrectCount = 0;

	// Use this for initialization
	void Awake ()
	{
	reRoll.Randomise ();
	}

void Start(){
	mycam = Camera.main;
	}

void FixedUpdate(){

	Selection ();

}
	// Update is called once per frame
	void Update ()
	{
			if (CorrectCount == 5) {
					PlayerPrefs.SetInt ("MiniScore", miniScore);
					Destroy (GameObject.Find ("Killswitch"));
			}

	}


void Selection ()
{
	Ray ray = mycam.ScreenPointToRay (Input.mousePosition);

	if (Input.GetKey (KeyCode.Mouse0)) {
		
		if (Physics.Raycast (ray, out hit)) {
			
			if (hit.transform.tag == "answer") {
				if (System.Convert.ToInt32(thisAnswer.text) % 3 == 0) {
					miniScore = miniScore + 100;
					CorrectCount = CorrectCount + 1;
					reRoll.Randomise ();
					Debug.Log (thisAnswer.text);
				} else if (System.Convert.ToInt32(thisAnswer.text) % 3 != 0) {
					reRoll.Randomise ();
					if (miniScore > 50) {
						miniScore = miniScore - 50;
					} else if (miniScore < 50) {
						miniScore = 0;
					}
					Debug.Log (miniScore.ToString ());
				}
			}
		}
	}
}

}

Never mind i changed my code to work around this issue.