From 6d89d7c794ddeac9e310ebcdd8fd4eaa7cfc0097 Mon Sep 17 00:00:00 2001 From: ichi23 Date: Wed, 10 Feb 2021 12:49:26 +0900 Subject: [PATCH] set Copy to child before destroying tmpParent fix --- Assets/UniGLTF/Runtime/UniGLTF/IO/gltfExporter.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/gltfExporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/gltfExporter.cs index 87fc0163c..9f9d4fd70 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/gltfExporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/gltfExporter.cs @@ -392,7 +392,10 @@ namespace UniGLTF { if (tmpParent != null) { - tmpParent.transform.GetChild(0).SetParent(null); + var child = tmpParent.transform.GetChild(0); + child.SetParent(null); + Copy = child.gameObject; + if (Application.isPlaying) { GameObject.Destroy(tmpParent);