Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/valiafetisov/unity-webgl-multiplayer
Unity WebGL basic multiplayer demo using WebSockets
https://github.com/valiafetisov/unity-webgl-multiplayer
biolerplate multiplayer multiplayer-server unity webgl websockets
Last synced: about 2 months ago
JSON representation
Unity WebGL basic multiplayer demo using WebSockets
- Host: GitHub
- URL: https://github.com/valiafetisov/unity-webgl-multiplayer
- Owner: valiafetisov
- License: mit
- Created: 2017-06-24T00:13:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T02:40:48.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T01:53:49.867Z (9 months ago)
- Topics: biolerplate, multiplayer, multiplayer-server, unity, webgl, websockets
- Language: C#
- Size: 1.68 MB
- Stars: 65
- Watchers: 6
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
![](screenshot.png)
# Unity WebGL basic multiplayer demo using WebSockets
The project is a basic working example demonstrating the possibility to exchange multiply players positions using websockets. Under the hood it uses slightly modified websockets plugin and small node.js server.
Main code can be found at [`node/app.js`](node/app.js) (node.js server), [`unity/Assets/Multiplayer.cs`](unity/Assets/Multiplayer.cs) (Unity C# script) and [`unity/Assets/Plugins`](unity/Assets/Plugins) (modified plugin).
### Running
1. Start node.js server from the `node` directory: `npm i && npm start`
2. Open `unity` folder as Unity project and run the game `CMD+P`### Developing
If you're willing to develop server code further, you may find useful to use `npm run dev` instead of `npm start` as it will start script with `nodemon` – a monitoring tool that will restart server after every edit.
### Credits
- Simple Web Sockets Plugin by Unity Technologies ([no longer available in the store](https://assetstore.unity.com/packages/essentials/tutorial-projects/simple-web-sockets-for-unity-webgl-38367))