This project provides a simple web server to run Unity builds in the browser using Node.js and Express. The server serves the Unity build files and automatically opens the browser to the homepage.
Make sure you have the following installed:
-
Clone the repository to your computer
git clone https://github.com/AnderSystems/UnityOpenWebGL -
Navigate to the project folder and install the dependencies
npm install -
Add the Unity Build
-
Open your Unity project and create a WebGL build.
-
After the build is created, copy the Builds/Web/Server/app folder into your project folder (where the index.js file is located).
-
-
Now, you can start the development server. Run
start-server.batindex.js. The server will start, and you'll see a message in the console with the address. The browser will open automatically with the server URL. -
After starting the server, open the browser and visit the following
http://localhost:1000The game should load directly in the browser!
- Port in use: If port 1000 is already being used by another process, the server will automatically try to open on another port. Alternatively, the server can ask if you'd like to try a different port or close the previous process.
Feel free to open issues and pull requests if you'd like to contribute to the project! We appreciate any contributions.