Hello!
I am looking to import an obj file at runtime so my game users can make their own maps.
I am not looking to spend a cent on this, I have found one on the wiki (http://wiki.unity3d.com/index.php?title=ObjImporter)
So if someone would be able to show me how to use this script from javascript, it would be greatly appreciated
I have tried already using SendMessage but to no avail. I simply do not know where to start to achieve this.
Thanks!
EDIT:
The code I have tried is this:
var existing : GameObject;
function Start () {
var newGO : Mesh;
var sc = gameObject.GetComponent("ObjImporter");
existing.GetComponent(MeshFilter).mesh = sc.SendMessage("ImportFile", "test.obj");
}
where existing is the gameobject i want to change the mesh, but it gives me a cannot convert void to unityengine.mesh.
↧