Available on the Marketplace! (Sep 1 2016)

Full access to UnrealEngine via reflection.

Tutorial video:

This looks awesome :smiley:

This looks great! I’ve got a few things which I implement at the moment using python and a socket interface with ue. I’d love to contain it all within the engine. At the moment I use python to load excel files into arrays and also act as an osc server which I use to trigger unreal events. Is it easy, do you think, to use unreal js to do these things internally? There are osc and excel libraries for js (I have zero experience with js).

Nice work !

Unreal.js isn’t compatible with node.js, but most of node.js features are not bound to its internal modules(process, net, fs, …). I don’t know how excel-parser is implemented, if the module can take binary buffer or array, you can do import *.xlsx and do the things what you want with Unreal.js.

If you find missng functionality what you want to use, just implement a C++ function within your UBlueprintFunctionLibrary(,_Create_Your_Own_to_Share_With_Others). That function will be accessible immediately. (No needs to add glue code)

Thank you! :slight_smile:

– Just added some example, please check out updated

Wow! This is amazing! Thank you nako_sung!

Thanks - praise from the big man too!

Looks like i’ve got some JS experimentation to get on with. I’ll keep this thread informed on how I get on here. I feel like this is going to be a pretty long thread when people spot it!

I hope you enjoy hacking UnrealEngine with .js! :slight_smile:

This is awesome !!! Really !!!
I do not have the time to test it for now but I will for sure as soon as I can.

How portable do you think it is ?
I remember iOS builds could not embed jit based VMs such as v8.
Is that old news ?

Thank you, AMIGrAve!

Mobile support is something I expected to be happened with the community. There is some working iOS build (GitHub - frida/v8: Frida depends on V8), but I don’t know about Apple’s policy about JIT VM. If Apple is forcing to use their JavascriptCore, Unreal.js needs to be redesigned to support several Javascript providers.


This is awesome. Not quite sure yet where I will use it, but that will come with familiarity!

Does this load js at runtime? e.g. could this be used to enable people to script mini-games within games? Possibilities…

Yes. Code is being loaded at runtime. Class declaration(and live reload) also takes in place while running. If you have a good package manager like npm, there will be lots of possibilities.

I forgot to implement USTRUCT and updated to support it. Dynamic unreal engine is a real fun. By the way, we(ncsoft) are using this plugin for rapid-prototyping and editor extension.

This is fantastic work, can’t wait to see how this evolves.

Hey Nako, thanks again for making this.

I’m still very new to Unreal so please bear with me.

What is the best way to pass information from JS to Unreal?

For example I have a ProceduralMesh like so:


It also has a UnrealJS component. With JS code here:


My goal is to use JS to generate the mesh (with something like THREE.js) and then inject the vertices, faces, and UVs back into Unreal. Can anyone think of a good way to do this?

I’m thinking to create a custom Actor in JS that hold information about the generated vertices, and then from Blueprint I can somehow reference that actor and obtain that data. However this seems extremely naive, not even sure if I can get pins from a JS-generated class. I’m wondering if there are better ways to do this?

That’s so cool! Thanks, nako_sung!

I’m working on the android port, so far so good.

@mflux - Currently javascript generated class has limited life time(created at runtime), it isn’t visible to blueprint. But you can expose JS functions by overriding pre-existing blueprint class. I think this will work for your case.

Nako, yep! I’ve done exactly that.

  1. I created a blueprint that has variables for vertices, triangles, normals, uvs, and sends it to a procedural mesh
  2. I extended this BP class in Javascript, and replaced the base-class’s vertices/faces etc with values generated from THREE.js
  3. And finally I have a V8 instance BP running in the level

The BP


The JS code

    // Blueprint class can be subclassed!    
    class ProceduralJSMesh extends Blueprint.Load('/Game/ProceduralBox').GeneratedClass {
        // constructor
        ctor() {
            // Subobject initialization, property initialization 
            this.bAlwaysRelevant = true
            console.log( 'constructing procedural js mesh' );
        // declare UPROPERTY's here
        // ; this.XXXXX/*[attribute+]+type*/;
        properties() {                                    
        ReceiveBeginPlay() {                                                                
            const geo = new THREE.BoxGeometry( 200, 200, 200, 1, 1, 1 );                        
            this.vertices = geo.faces.reduce( function( arr, f ){         
                arr.push( threeVertexToUEVertex( geo.vertices f.a ] ) );
                arr.push( threeVertexToUEVertex( geo.vertices f.b ] ) );
                arr.push( threeVertexToUEVertex( geo.vertices f.c ] ) );                
                return arr;
            }, ] );
            this.triangles = geo.faces.reduce( function( arr, f ){
                arr.push( f.a );
                arr.push( f.b );
                arr.push( f.c );                               
                return arr;
            }, ] );
            this.normals = geo.faces.reduce( function( arr, f ){                     
                arr.push( threeVertexToUEVertex( f.vertexNormals 0 ] ) );
                arr.push( threeVertexToUEVertex( f.vertexNormals 1 ] ) );
                arr.push( threeVertexToUEVertex( f.vertexNormals 2 ] ) );                    
                return arr;
            }, ] );
            this.uvs = geo.faceVertexUvs[0].reduce( function( arr, uvs ){                
                    X: uvs[2].x,
                    Y: uvs[2].y
                return arr;                
            }, ] );
            console.log( 'vertices length', this.vertices.length );
            console.log( 'triangles length', this.triangles.length );
            console.log( 'normals length', this.normals.length );                                                  

The result:

Damnit :slight_smile: I’m so close. The winding ordering for faces is wrong, but I’ve tried for a few hours to fix this by flipping the vertices around with no success.

Anyway, this has a lot of promise, gonna keep going.

I’ve been following this topic for some days, cool thing Unreal JS is :slight_smile:
As per the latest additions by Nako (check github!) the asset references can be resolved easily by just adding the class in the properties:


this will help the cooking process to keep the references and also provides a simple access which is cool!

What i am missing is the ability to include the *.js files in the PAK. I unfortunately only got the script being executed if i copy them to the cooked folder:


Including the scripts into the PAK does not work, or did i just messed up something here? :slight_smile:

I’ll investigate it. :slight_smile:

IntelliSense error

IntelliSense error,How to VS 2013 Use The Unreal.js IntelliSense?