I want to make my game moddable by letting players put scripts in a folder in the game files, but I’m not sure how I can load those files into the game in some form. How do I do this?
There’s no facility to compile scripts in your built game engine. You can always use an interpreted language… I have used MoonSharpLUA and it’s pretty slick in Unity.
As for other ways, check on the mods forum. We here don’t do much modding because we have the Unity editor and our project source code!
Actually you can just load Assemblies from DLL files at runtime, with no need in lua. Check on the c# reflection to get more information.
Hello @Chazzwazzler
You can use an amazing tool on the asset store : Roslyn C# - Runtime Compiler
I’m currently using it and works very welll.
As @lyrapuff said it works with DLL and assemblies.
The idea is Unity works with compiled scripts so if you try adding a non compiled one it can’t work Roslyn allow you to compile it on an assembly and then use it.