Loading a custom javascript from resources folder

Hi there,

Let think exotically.

In my previous 3dengine I actually integrated a scripting language which dynamically loaded meshes in and out of mem + other assets.

Now it would be nice if I could load in custom javascripts too.
So, is it possible somehow to load an extra javascript file into my project and for example call its init() function ?

Most important would be to know if it can be done, and secondly (if it can be done) how to do it :slight_smile:

eval (“The java script code you want to execute in this string”);

Joachim,

I’ll lookup on eval, but I actually meant to be able to load for example a complete 800-lines long .js file an then atach it in code to a dummy gameobject whereafter I can call its init() function.

Regards,

Bart

I don’t think that’s possible…the code is compiled, not interpreted, and there’s no such functionality to compile code with the runtime. However, you could write your own scripting language in Unity. :slight_smile:

–Eric