[SOLVED]c# Error, sorry for the noob question

using UnityEngine;
using System.Collections;

public class ScoreManager {
	private static int Score;
	private static GameObject scoreText;
	public static void setUp(Vector2 scoreTextPos){
		scoreText=Resources.Load("GuiPrefabs/GUIText") as new GameObject(); // Getting Error on this Line
		scoreText.transform.position=Vector3(0,1,0);
		setScorePosition(scoreTextPos);
	}
}

I have been using unity for a couple of months now, but I am just getting into c# so please bear with me.
This is a piece of the code I am using to create a ScoreManager class, I am getting an error that says

 Expecting `;'

I have looked on the fourms and the only things I can find was something about decaring a public variable inside of an object which I don’t belive that I have done. Any help on this would be greatly appreciated. Thank you so very much.

scoreText=Resources.Load("GuiPrefabs/GUIText") as GameObject;

Remove the “new” and the parens, the as operator is for safe casting when the value may be null, you aren’t actually instantiating anything.

It’s the word “new” on that line. Rather than using the as operator, it’s more common just to cast the value. Also, you have to instantiate the object before using it. You probably want something like:-

scoreText = (GameObject) Object.Instantiate(Resources.Load("GuiPrefabs/GUIText"));

After doing some more experiementing I came up with this solution.

public class ScoreManager {
	private static int Score;
	private static GameObject scoreText;
	public static void setUp(Vector2 scoreTextPos){
		scoreText= GameObject.Instantiate(Resources.Load("GuiPrefabs/GUIText") as GameObject) as GameObject;
		scoreText.transform.position= new Vector3(0,1,0);
		setScorePosition(scoreTextPos);
	}
}

And it works out fine, Sorry I answered my own questions but hey if anyone else finds this usefull that would make me happy, Go Unity!

Awesome thanks for those tips they they sure will help me.