Hi. I want to load a mesh,probably .fbx,to gameObject in c#.
How can I do that?
I guess I should create gameObject as follow,and load mesh.
GameObject x = new GameObject();
//then,load mesh to gameObject
Instantiate(x,position,rotation);
help me, plz.
Not in Unity,but in PC executable file.
Can I add it like that?Because I want to load meshes
by reading a xml file.Write the file name in xml,and
placing the mesh in unity folder,and can it load it?
----Q2.--------------------------------------------------
How can I add component to gameObject?
How can I create componenent?
If I want to create collider component,do this?
BoxCollider x = new BoxCollider();
and,
GameObject c=new GameObject();
and how can I attach that component to that
gameObject?
—Q3----------------------------------------------------
If I want a gameObject instantiate at
position(2,4,6),and rotation(20,50,30),
how can I do that?
Instantiate(gameObject,???,???);
vector in it like below?
Instantiate(gameObject,new Vector(2,4,6),???);
then,rotation?