diff --git a/Assets/VRM/Editor/Format/VRMEditorImporterContext.cs b/Assets/VRM/Editor/Format/VRMEditorImporterContext.cs index f29d76f10..ae0946d36 100644 --- a/Assets/VRM/Editor/Format/VRMEditorImporterContext.cs +++ b/Assets/VRM/Editor/Format/VRMEditorImporterContext.cs @@ -141,6 +141,9 @@ namespace VRM loaded.TransferOwnership(SaveAsAsset); var root = loaded.Root; + // Remove RuntimeGltfInstance component before saving as a prefab. + UnityObjectDestoyer.DestroyRuntimeOrEditor(loaded); + // Create or update Main Asset if (m_prefabPath.IsFileExists) { @@ -155,7 +158,7 @@ namespace VRM } // destroy GameObject on scene - GameObject.DestroyImmediate(root); + UnityObjectDestoyer.DestroyRuntimeOrEditor(root); foreach (var x in m_paths) {