Hi there ![]()
I am experiencing a weird bug when loading a scene from an asset bundle -
for some bizarre reason, the GameObjects within the scene are reorganized.
Specifically - they are sorted alphabetically.
For example, I am building a simple mostly empty scene with the following hierarchy:

However, when loading that scene from the asset bundle, it looks like this:

The following is my asset bundle building logic:
[MenuItem("Assets/Build AssetBundles")]
private static void BuildAllAssetBundles()
{
string bundleName = "emptyScene";
string timestamp = DateTime.Now.ToShortTimeString().Replace(":","");
string assetBundleDirectory = "Assets/StreamingAssets";
if (!Directory.Exists(Application.streamingAssetsPath))
Directory.CreateDirectory(assetBundleDirectory);
AssetBundleBuild[] buildMap = new AssetBundleBuild[1];
buildMap[0].assetBundleName = bundleName + "_" + timestamp;
buildMap[0].assetNames = new string[1]
{
"Assets/Scenes/EmptyScene.unity"
};
BuildPipeline.BuildAssetBundles(assetBundleDirectory, buildMap, BuildAssetBundleOptions.None,
EditorUserBuildSettings.activeBuildTarget);
}
Has anyone experienced this bug before? Perhaps a clue as to what may be the cause of the issue?
Thanks in advance!