- Home /
How can I load in assets for a users mod?
I have a script running that opens an asset bundle. The asset bundle isn't made for the game running the script, it's made externally. I run:
var path = @"mods\myMod\Assets" // mods is in the root dir
var bundle = AssetBundle.LoadFromFile(Path.Combine(Application.dataPath + Path))
but bundle is always null no matter what I do. The game running the script is build with unity 2019.4 and I'm creating the bundle with unity 2019.4
All I can think of is that there must be something wrong with how I'm generating the asset bundle? But I ran a script that was able to load it in the project that generated it. It just doesn't work in the project being modded. I have output confirming that the script in running, it's just this piece. Any advise?
If you know of a better way to achieve this let me know, I just want to be able to load assets from modders