Closed pzhine closed 1 year ago
I figured it out. The glTF had no defaultSceneIndex. As stated in the comments for instantiateMainScene
: If the main scene index is not set, it instantiates nothing (as defined in the glTF 2.0 specification)
.
The updated code below works:
if (gltfImporter.defaultSceneIndex.HasValue)
{
gltfImporter.InstantiateMainScene(instantiator);
}
else
{
for (int sceneId = 0; sceneId < gltfImporter.sceneCount; sceneId++) {
gltfImporter.InstantiateScene(instantiator, sceneId);
}
}
Describe the bug I have a glTF exported from Cinema 4D that works fine with the editor import but not with the runtime import. I see no errors or messages in the console when running the runtime import, but the game object that should contain the model is simply empty.
Files https://cdn01.elysium.ar/sim/troubleman.glb
To Reproduce Steps to reproduce the behavior:
Start
method of a game object:Desktop (please complete the following information):