A communication layer between a web page and Unity using WebSockets.
Open a terminal in the web/
directory and run:
yarn install
Open a second terminal in the web/
directory and start the development server:
node server.js
yarn dev
If successful, you should see a message like this:
VITE v5.4.14 ready in 337 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help
Now, open your browser and go to:
http://localhost:5173
You should see a webpage with a "Toggle Effect" button.
If the button is grayed out, the server is not running—see the "Launch the Server" section.
- Open Unity Hub.
- Click Add → Add project from Disk.
- Locate and select the
unity-client
folder in your project. - Once added, it should appear in your projects list—open it.
- Open the SampleScene (if not already open).
- The scene contains two objects:
- One for handling the server connection.
- One for the visual effect.
- Press Play. If the server is running, you should see this message in the Unity Console:
Connection open!
- If you don't see the message, make sure the server is running.
- Once connected, you can use the webpage to control the effect in Unity.