useEventfulState() has landed! Check Here for more info.

New features and bug fixes will land in the private github repo before becoming available on the Asset Store. To request access to the repo, please send an email or pm Singtaa#4915 on Discord with your Github username and OneJS Order/INV number.

This sample is available as a public repo at https://github.com/DragonGround/FortniteSample

Step-by-step Setup

  • Extract this repo to {ProjectDir}/OneJS/ForniteSample
  • Under {ProjectDir}/OneJS, make a index.tsx file like below:
import { render, h } from "preact"
import FortniteSample from "FortniteSample"
import { update } from "tweenjs/tween"

render(<FortniteSample />, document.body)

function animate(time) {
    requestAnimationFrame(animate)
    update(time)
}
requestAnimationFrame(animate)
  • Open {ProjectDir}/OneJS with VSCode and run the tsc: watch task (Ctrl + Shift + B)
  • In Unity, drag a ScriptEngine prefab onto the scene.
  • Import the included CharacterManager.cs file into Unity and drag the MonoBehaviour onto a scene.
  • Then include CharacterManager into the Objects list under ScriptEngine's INTEROP; name it to charman
  • Make sure Live Reload's entry script is set to index.js.
  • Hit Play and you should be all set

Everytime you checkout a new OneJS version (from the private repo or Asset Store), make sure you also update your ScriptLib folder. You can do so by deleting the old one, a new one will be automatically created upon running ScriptEngine. This step will be automated in the future.