I've recently encountered AssetBundles and tried to implement it in my project. I have a pretty simple game where controlling a character you should collect coins. I created the AssetBundle where I made prefabs and put everything from the game scene (background, player, terrain, etc...) into the AssetBundle. However, when loading objects from the bundle to the game scene, despite having the same size and transform parameters in the inspector, they are bigger than their original prefabs when starting a game. When it comes to the loaded character, not only is it ten times the size of the original but it also needs to be readjusted in script dependencies during the game to control it with a joystick. In terms of prefab size discrepancy, I think it has something to do with the loading screen as everything that comes out of the bundle is scaled to its size (see Fig.1) but I don't know why it happens nor how to fix it.
The script which loads prefabs:
public class LoadAssetBundles : MonoBehaviour
{
AssetBundle loadedAssetBundle;
public string path;
public string assetName;
void Start()
{
LoadAssetBundle(path);
InstantiateObjectFromBundle(assetName);
}
void LoadAssetBundle(string bundleUrl)
{
loadedAssetBundle = AssetBundle.LoadFromFile(bundleUrl);
}
void InstantiateObjectFromBundle(string assetName)
{
var prefab = loadedAssetBundle.LoadAsset(assetName);
Instantiate(prefab);
}
}