Skip to content

Using react-unity-webgl with Next JS #291

Answered by 3y3net
3y3net asked this question in Help Wanted!
Discussion options

You must be logged in to vote

So, let me explain the process carefully to allow others use your lib with NEXT JS

  1. Download the latest version of the Library that includes the changes for Next JS (server side rendering)
  2. Make a deployment on Unity without compression (probably, it will work compressed in a server, but for developing, use uncompressed deployment)
  3. Place the directories 'Build' and 'TemplateData' in the 'public' folder at your project
  4. Use this configuration:
    const unityContext = new UnityContext({
    loaderUrl: "Build/deploy.loader.js",
    dataUrl: "Build/deploy.data",
    frameworkUrl: "Build/deploy.framework.js",
    codeUrl: "Build/deploy.wasm",
    });

DONE!!!

Some other advises...

  • create the 'unityContex't const outs…

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@3y3net
Comment options

@jeffreylanters
Comment options

@3y3net
Comment options

@3y3net
Comment options

@jeffreylanters
Comment options

Comment options

You must be logged in to vote
1 reply
@3y3net
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by 3y3net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants