Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice
  2. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Loading up an obj at runtime from the oculus quest sd card

Discussion in 'AR/VR (XR) Discussion' started by jeromegold, May 3, 2020.

  1. jeromegold

    jeromegold

    Joined:
    Apr 7, 2020
    Posts:
    20
    Hi,

    I'm using ObjImporter to load up an obj at runtime.
    i've created a sphere prefab and i'm using that as the base for loading up my obj which is a wooden board.

    board = Instantiate(prefab, new Vector3(6, 1, 9), Quaternion.identity) as GameObject;
    ObjImporter newMesh = new ObjImporter();
    Mesh mesh = newMesh.ImportFile(path);
    board.GetComponent<MeshFilter>().mesh = mesh;

    When debugging to the console board is instantiated and its transform.position is correct. But there is nothing to see.

    The sphere prefab that is being used has a meshfilter, meshrenderer, material, rigid body and collision on it.
    Just wanted to swap out the mesh. The sphere mesh seems to be gone but the mesh.obj isn't loaded up.

    And path for the file is /storage/emulated/0/Android/data/com.xxx.xxxx/files/mesh.obj

    After any advice. Thx.
     
    EndritP likes this.
  2. EndritP

    EndritP

    Joined:
    May 10, 2018
    Posts:
    1
    Did you find a solution for this?
     
unityunity