Model imported at runtime not showing in-game

Hi Unity Community

I am trying to use the .obj importer which seems to be successfully loading a .obj model at runtime as a gameObject from my local drive (signified by the debug vertex count and position returns), however the model does not seem to appear in the main camera.

I have tried to insure that the model has the necessary components and is in view from the camera, however, as the script is not throwing me any errors, I cannot seem to resolve this; any ideas?

#pragma strict

var impMesh : Mesh; //imported mesh assigned here
var impTex : Material; //imported material (missing from import code atm)
	var matShader : Shader;
	//var matTex : Texture;
	//var matColour : Color;
var emptyObj : GameObject; //empty placeholder for mesh
var instPos : Vector3; //imported obj inst location
var meshObj : GameObject; //GameObj mesh to be assigned to
var objMesh : Mesh; //mesh of meshObj
var objTex : Material; //assigns texture to model (subs in plain material atm)

function Start () 
{
  	MeshImport();
}

function Update () 
{

}

function MeshImport() 
{
	var objImp = new ObjImporter(); //creates ObjImp class instance
	var impMesh = objImp.ImportFile("/Users/...fileAddress../monkey.obj"); //assigns meshImp w/ mesh -> replace w/ button
	var meshObj = new GameObject ("TestObject", typeof(MeshRenderer), typeof(MeshFilter)); //create empty gameobject
	var objMesh = meshObj.GetComponent(MeshFilter).mesh; //assign mesh to var
	var objTex = meshObj.GetComponent(MeshRenderer).material;
	objMesh = impMesh; //assigns imported mesh to mesh of gameobject
	objTex = impTex; //impTex set in Inspector atm
	meshObj.transform.position = Vector3(0,0,-10);
	Debug.Log(objMesh.vertexCount);
	Debug.Log(meshObj.transform.position);
}

Many thanks in advance!
Ryan

This is better :

var meshFilter = meshObj.GetComponent<MeshFilter>();
meshFilter.mesh = impMesh;

Else you’re just assigning the mesh to a local variable.

Same for the texture.