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);
}