Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Question How to get multiplayer on webgl

Discussion in 'Multiplayer' started by zapyray, May 6, 2021.

?

Is it possible to create a multiplayer browser game with unity?

  1. Yes

  2. No

  3. Depends on the requirements

Results are only viewable after voting.
  1. zapyray

    zapyray

    Joined:
    Jul 30, 2019
    Posts:
    3
    Hey guys,

    I am making a website for webgl games. Most of my games will be single player but I will have a couple of multiplayer games. Mainly board games and a platformer that you can play with a few friends. I would probably never have more than 6 players and there is no automatic match making.

    I want to know that with the current unity webgl builds , what are my options(if I have any) so players on my website can play with their friends.

    Some places say its impossible while some suggest it is possible with a few restrictions

    Would love to know what you guys think.

    btw , I don't have any knowledge of unity multiplayer yet but I will pick up a framework and start learning , soon as i know what my options are.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,824
    WebGL has significant networking limitations imposed by web browsers. I believe you're limited to acting as a web socket client only. There are several networking API's for Unity which have web socket support for WebGL builds. I believe Mirror is the most popular.
     
  3. zapyray

    zapyray

    Joined:
    Jul 30, 2019
    Posts:
    3
    Awesome , that's the most clear answer I have ever heard !!

    A quick question,
    Should I start learning mirror or wait(and start learning) the new unity networking solution?
    Also , would one framework work for both mobile and web ?
    of course the way I communicate with the server would change
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,824
    I haven't done any WebGL networking myself. I see that the original creator of MLAPI (the now official networking solution from Unity), has a web sockets wrapper posted to github.

    https://github.com/MidLevel/MLAPI.WebSockets

    My recommendation would be to try them both and see which one you like. I don't know if web sockets for either networking implementation are also supported on mobile.
     
    zapyray likes this.
  5. DaveA

    DaveA

    Joined:
    Apr 15, 2009
    Posts:
    309
    I'm using Photon with my webGL game, seems to be fine. I do need help with it, will pay, contact me if interested.
     
  6. LtTops

    LtTops

    Joined:
    Jul 7, 2015
    Posts:
    1
    Just starting to look at a very similar project, I'd like to develop a WebGL multiplayer board game (roll dice and move type thing). @zapyray @DaveA have you had any success and where did you go for answers / examples?
     
  7. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    4,282
    Unity runs on all the platforms.
    all you need is a websocket transport.
     
  8. zapyray

    zapyray

    Joined:
    Jul 30, 2019
    Posts:
    3
    Sir,
    Your website does not have any credibility .. there are no pricing plans and no turorials on that tech.
    Besides, u seem to have been going all over the internet yesterday and pasted that exact response.

    If you want to introduce your product please have some kind of youtube vide , demo or documentation.
    There nothing on the site besides the option to give u guys our email
     
    VOTRUBEC likes this.
  9. sebastiao_lucio

    sebastiao_lucio

    Joined:
    Mar 14, 2018
    Posts:
    17