how to create my fbx gameobject using script in the game

Hi! i am new to unity and i want to know… i have a script “GameObject go = GameObject.CreatePrimitive (PrimitiveType.Cube);” to create cube but i have imported another fbx model from a 3d software and instead of using cube i want to use my own fbx model can anyone tell me how to do it?

My Complete code is:

private void SpawnObj(Vector3 pos, Vector3 scale)
{
		GameObject go = GameObject.CreatePrimitive (PrimitiveType.Cube);
		go.transform.localPosition = pos;
		go.transform.localScale = scale;
		go.AddComponent<Rigidbody> ();

		go.GetComponent<MeshRenderer> ().material = MatBl;
		ColorMesh (go.GetComponent<MeshFilter> ().mesh);
	}

You are going to want to look into instantiating your model here is the manual page on it.

The code to do that would be:

 public GameObject myModel;

private void SpawnObj(Vector3 pos, Vector3 scale)
 {
         Instantiate(myModel, Transform.position, Transform.rotation);
         myModel.transform.localPosition = pos;
         myModel.transform.localScale = scale;
         myModel.AddComponent<Rigidbody> ();
 
         myModel.GetComponent<MeshRenderer> ().material = MatBl;
         ColorMesh (myModel.GetComponent<MeshFilter> ().mesh);
     }

You will have to drag and drop your model to the myModel variable that is now available in the inspector