@@ -868,22 +868,21 @@ internal static void CopyComponents(GameObject to, GameObject from, GameObject r
868
868
continue ;
869
869
}
870
870
871
- // ignore MeshFilter, but still ensure scene references are maintained
872
- if ( fromComponent is MeshFilter )
871
+ // ignore MeshFilter and Transform, but still ensure scene references are maintained.
872
+ // Don't need to copy regular transform as the values should already be correct in the FBX.
873
+ // Furthermore, copying transform values may result in overrides in the prefab, which is undesired as if
874
+ // the transform is updated in the FBX, it won't be in the prefab.
875
+ if ( fromComponent is MeshFilter || fromComponent is Transform )
873
876
{
874
- FixSceneReferences ( fromComponent , to . GetComponent < MeshFilter > ( ) , root ) ;
877
+ FixSceneReferences ( fromComponent , to . GetComponent ( fromComponent . GetType ( ) ) , root ) ;
875
878
continue ;
876
879
}
877
880
878
881
// ignore FbxPrefab (when converting LinkedPrefabs)
879
882
// Also ignore RectTransform, since it is not currently possible to switch transforms
880
883
// in a prefab.
881
- // Don't need to copy regular transform either as the values should already be correct in the FBX.
882
- // Furthermore, copying transform values may result in overrides in the prefab, which is undesired as if
883
- // the transform is updated in the FBX, it won't be in the prefab.
884
884
if ( fromComponent is UnityEngine . Formats . Fbx . Exporter . FbxPrefab ||
885
- fromComponent is RectTransform ||
886
- fromComponent is Transform )
885
+ fromComponent is RectTransform )
887
886
{
888
887
continue ;
889
888
}
0 commit comments