Skip to content
Unreal.js: Javascript runtime built for UnrealEngine 4
C# Batchfile C++ C
Tree: 83d2556fd1
Clone or download

Latest commit

Latest commit 83d2556 May 16, 2016

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Build Plugins folder is a symlink Jan 15, 2016
Examples extension updated May 1, 2016
Plugins plugin updated May 16, 2016
doc/images gif updated Apr 10, 2016
.gitattributes initial commit Nov 20, 2015
.gitignore .gitignore updated to exclude node_modules under Examples Feb 14, 2016
.gitmodules split into submodule Apr 3, 2016
LICENSE Update LICENSE Nov 18, 2015
README.md Update README.md May 16, 2016

README.md

star this repo fork this repo download

Unreal.js

Unreal.js is a plug-in which brings V8-powered Javascript into UnrealEngine4.

Features

  • 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, ...

Wiki

Dummy demo

Install and play

  • Video tutorial available!
  • Make sure your directory layout is correct:
Examples/          # project root directory
   Content/
       Scripts/   # "npm install" here
   Plugins/
       UnrealJS/
  • Open Examples/JavascriptPlayground.uproject
  • Activate JavascriptConsole by clicking Windows - Developer Tools - JavascriptConsole.

Build

  • Windows
  • 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
  • Mac

License

Apache2

Examples

2048

Springy

Editor extension

Create a new actor

let myActor = new Actor(GWorld,{X:10,Y:20,Z:30});
myActor.SetActorLocation({X:40,Y:80,Z:120});

Subclass an existing class

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);
}

Node.js like

let _ = require('lodash');
let kick = () => {
  console.log("Hello timer!",_.keys(this));
  setTimeout(kick,1000);
};
kick();
You can’t perform that action at this time.