- Home /
Question by
Jela · Aug 02, 2014 at 03:03 PM ·
gameobjectdisplayfbximporter
I want to display imported fbx object inside imported fbx object.
Hi guys. I've tried to make a program that will let me display the imported fbx file through script. Now what I'm planning to do is to display this fbx file, or obj inside another fbx file. It's like inserting this obj inside an cube with an fbx extension because I've edit the renders of the cube. Please help me. Thanks in advance.
using UnityEngine; using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
public GameObject obj;
void Start(){
Transform NewBehaviourScript = Instantiate(obj,Vector3.zero,Quaternion.identity) as Transform;
}
}
Comment
I have no idea what you are asking, but with respect to the code fragment, you need to either make 'obj' a Transform and then reinitialize it by drag and drop in the Inspector, or 'newBehaviorScript' a GameObject (and use 'as GameObject'). The latter would be:
GameObjdct go = Instantiate(obj,Vector3.zero,Quaternion.identity) as GameObject;