Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question How to get multiplayer on webgl

Discussion in 'Multiplayer' started by AzkalanKen, 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. AzkalanKen

    AzkalanKen

    Joined:
    Jul 30, 2019
    Posts:
    7
    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,847
    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. AzkalanKen

    AzkalanKen

    Joined:
    Jul 30, 2019
    Posts:
    7
    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,847
    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.
     
    AzkalanKen likes this.
  5. DaveA

    DaveA

    Joined:
    Apr 15, 2009
    Posts:
    310
    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. mischa2k

    mischa2k

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

    AzkalanKen

    Joined:
    Jul 30, 2019
    Posts:
    7
    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