问题描述
- 为什么Unity 3d中模型产生偏移?
-
在unity3d中确定位置坐标生成模型,调用生成模型,然而模型不再该确定的位置上。这个问题怎么解决?
怎样将模型调用出现在设定的位置上?void search(string information) { for (int i = 0; i < list.Count; i++) GameObject.Destroy((Object)list[i]); list.Clear(); for (int i = 0; i < Remdata.Length; i++) { for (int j = 0; j < Remdata[i].Length; j++) { Regex reg = new Regex(Remdata[i][j]); if (reg.IsMatch(information)) { //statics = resource[i]; //GameObject gFbx1 = (GameObject)Instantiate(objs[i], new Vector3(0,0, 2),new Quaternion()); gFbx1 = (GameObject)Instantiate(Remobjs[i]); //调用模型 //Debug.Log(gFbx1); //GameObject gFbx1 = (GameObject)Instantiate(objs[i]); //调用模型 //list.Add(gFbx1); switch (temp) { case 0: gFbx1.transform.position = new Vector3(0, 0, 2); break; case 1: gFbx1.transform.position = new Vector3(0, 2, 2); break; case 2: gFbx1.transform.position = new Vector3(2, 0, 2); break; case 3: gFbx1.transform.position = new Vector3(0, 5, 2); break; case 4: gFbx1.transform.position = new Vector3(0, 0, 5); break; default: break; // list.Add(gFbx1); } list.Add(gFbx1); temp++; } } } }
解决方案
时间: 2024-09-13 05:23:22