Search Unity

How to import these kind of FBXs?

Discussion in 'Asset Importing & Exporting' started by dancivuk, Aug 6, 2021.

  1. dancivuk

    dancivuk

    Joined:
    Jun 25, 2021
    Posts:
    2
    upload_2021-8-6_14-56-0.png

    Resources.Load<Mesh> doesn't work, i've tried every combination under the sun (different paths, all of these file names, you name it.)

    Directory.GetFiles reports the right number of files in the folder, but it just won't load the damn thing. Doesn't help that it doesn't even say what the type of these things is...
     
  2. dancivuk

    dancivuk

    Joined:
    Jun 25, 2021
    Posts:
    2
    Small edit... when i say "Import" i mean load it into the scene... but it always returns Null or array length 0
     
  3. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Directory.GetFiles will not work in a build game for the Ressource folder.
    The Ressource folder will be compiled to one file containing all the imported assets of the folder.
    For assets the model name is not the same as the mesh name.
     
  4. George-Ing

    George-Ing

    Unity Technologies

    Joined:
    Jan 14, 2020
    Posts:
    78
    Could you perhaps elaborate on your use case? Is there a reason you're loading specifically the mesh subasset as opposed to the entire GameObject?

    For example, one could put the prefab in the scene by using:
    Code (CSharp):
    1. Instantiate(Resources.Load<GameObject>("MyFilePath"));