Hello,
I’m new on Unity3d platform and I’m trying to load a FBX file at runtime from my Web Player sample application.
I have created a GUI button which fires a command:
public GameObject prefab;
void OnGUI() {
if (GUI.Button(new Rect(10, 70, 50, 30), "Load"))
{
prefab = (GameObject)Resources.LoadAssetAtPath("Assets/MyFile.fbx", typeof(GameObject));
prefab.transform.localScale = new Vector3(500,500,500);
prefab.transform.RotateAround(Vector3.up,3.141592F);
Instantiate(prefab, new Vector3(100, 0, 35), Quaternion.identity);
}
}
It works fine while inside Unity3d editor but when I do a build and run the application can’t find the FBX file at runtime. I have tried to put it along the HTML file and also inside a “Assets” sub folder or even a “Resources” sub folder.
Any clue why it is not working?
Regards,
Fernando.