Unreal.js is a plug-in which brings V8-powered Javascript into UnrealEngine4.
-
Powered by latest V8 (ES6)
-
CommonJS modules
-
Full access to the whole UnrealEngine API
-
Free to subclass existing classes including blueprint
-
Live reload
-
Communicate with outer world: REST(http), websocket, process(pipe), arraybuffer, ...
-
Bridge API for editor extension
-
Auto-completion for Visual Studio Code (auto-generated *.d.ts)
-
Debugging within Visual Studio, Visual Studio Code, WebStorm and all IDE which supports V8 protocol
-
Profiling supported by V8
-
Dedicated Javascript console on UnrealEditor
-
(Full) access to existing javascript libraries via npm, bower, ...
- Very simple demo available (https://github.com/ncsoft/Unreal.js/archive/snippet-editor.zip)
- Video tutorial available!
- Make sure you have UnrealEngine 4.11.2 canonical build.
- Download prebuilt UnrealJS plugin and unzip into
Examples/Plugins/UnrealJS
.
- Make sure your directory layout is correct:
Examples/ # project root directory
Content/
Scripts/ # "npm install" here
Plugins/
UnrealJS/
cd Examples/Content/Scripts && npm i
to install node.js packages which are required to run examples.- Open
Examples/JavascriptPlayground.uproject
- Activate
JavascriptConsole
by clickingWindows - Developer Tools - JavascriptConsole
.
- Download prebuilt V8 and unzip into .../Plugins/UnrealJS. (files are located in releases)
mklink /d /j Build/Plugins Plugins
mklink /d /j Examples/Plugins Plugins
Apache2
let myActor = new Actor(GWorld,{X:10,Y:20,Z:30});
myActor.SetActorLocation({X:40,Y:80,Z:120});
class MyActor extends Actor {
properties() {
this.MyProp/*EditAnywhere+Replicated+int*/;
}
RPC(x/*int*/) /*Server+Reliable*/ {
console.log('This function is replicated',this.MyProp++);
}
}
let MyActor_C = require('uclass')()(global,MyActor);
if (GWorld.IsServer()) {
new MyActor_C(GWorld);
}
let _ = require('lodash');
let kick = () => {
console.log("Hello timer!",_.keys(this));
setTimeout(kick,1000);
};
kick();