public static void ExportPrefab(GameObject prefab, string path) { GameObject go = Instantiate(prefab); go.name = prefab.name; SceneToGlTFWiz comp = go.AddComponent <SceneToGlTFWiz>(); comp.ExportGameObjectAndChildren(go, Path.Combine(path, go.name + ".gltf"), null, false, true, false, false); DestroyImmediate(go); }