Hi Mihir,
I suppose you are using this sample. You can't use 'GameObject.CreatePrimitive' for instantiating your gameObject, which is not of primitive type. You have to use 'GameObject.Instantiate' instead, for instantiating your player as follows:
public GameObject playerPrefab;
private static GameObject myPlayer;
void Start(){
///code.........
myPlayer = playerPrefab;
addPlayer();
}
public static void addPlayer()
{
//you have to change this piece in this method.
obj = Instantiate (myPlayer);
obj.transform.position = new Vector3(732f,1.5f,500f);
}
For more info on instantiating different player object, please check our
VikingDemo project.
Let us know if you face any problem.