I want to setup a way for modders to include assetbundles in their mods and and those assets loaded. As a test I have a script running:
var path = @"mods\myMod\Assets";
var bundle = AssetBundle.LoadFromFile(path);
but bundle is always null. The assetbundle is generated with the same version of unity (2019.4) as the game running the scrips. I tried putting it in the streaming assets dir and using the full path from c with Application.dataPath but nothing works. I confirmed the file exsists with System.IO and I successfully wrote a script to load the bundle in the project that generated it. is there something I’m missing? I just doesn’t work in the mod script.
Result will be null if bundle is not found or incompatible.
Try placing bundle inside the root dir where player.exe is, give it extension for the posterity’s sake (*.unity3d) and load it
var bundle = AssetBundle.LoadFromFile(“muhbundle.unity3d)”;
If it wont load then you’ve built it wrong. Are you using AssetBundleBrowser or you own custom script workflow?