Siccity / GLTFUtility

Simple GLTF importer for Unity
MIT License
976 stars 217 forks source link

Unable to load Sub-meshes #209

Open AlwinJoshy opened 1 year ago

AlwinJoshy commented 1 year ago

I was facing issue with loading mesh with sub meshes. the code was breaking and the whole model doesn't show up. I manage to fix it by moving a line of code down.

1 - go to GLTFMesh.cs 2 - line 254 newMesh.subMeshCount = selected.subMeshCount; 3 - move it under line newMesh.triangles = selected.triangles; 4 - because assigning the tringles resets the sub mesh count

that should fix it