Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by argentummanusbeta · May 10, 2018 at 05:37 PM · networkingmultiplayerwebglserverhosting

I am trying to create an online multiplayer game, but UnityEngine.Networking isn't supported with WebGL exports. What would be the best way to create a networked game for WebGL?

I have a game that I posted on my website as a WebGL export. But the problem is that its a networked game, where all the scripts use the class UnityEngine.Networking. After I posted the game I found out that WebGL can't create servers... No Problem, so I created a server, after that I couldn't join my server. After some research I found out that WebGL dose not support UnityEngine.Networking. What would be the best approach to creating this game where it would work with a WebGL export (Preferably where WebGL User can also host the server).

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by softrare · May 10, 2018 at 08:07 PM

UnityEngine.Networking does work with WebGL, only you need to activate it on the NetworkManager (WebSockets). And note, that you cannot connect with any other client platform than WebGL if you do activate it.

Hosting a server is impossible though with WebGL, you have to make the server dedicated.

EDIT: Just corrected the last sentence where it said "Hosting a server is impossible with WebSockets enabled". That can be confusing as it is possible to have WebSockets enabled and hosting a server surely, but not WHILE you're running a WebGL build in a web browser.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image argentummanusbeta · May 11, 2018 at 11:45 AM 0
Share

Ok, thanks for the advice. But I have a few questions about this... First of all I don't know what a dedicated server is. And I have read a few articles that talk about dedicated servers, but I know what one is, much less how to set one up.

Is there an article that could explain this to me?

Thanks for you help so far.

avatar image softrare argentummanusbeta · May 11, 2018 at 11:58 AM 0
Share

A dedicated server in this case is a game server ideally running 24/7 on a dedicated server machine which in most cases is not a personal computer but a virtual or physical server in a datacenter. So in ga$$anonymous$$g networks we speak of a dedicated server as opposed to a "host" which would just be a server being run for the amount of time a game is played and where the server player himself spawns a character and particitpates in the game play as client as well. A dedicated server only waits for other players from the Internet to connect to it, but does not spawn itself a player because noone is actively "sitting in front of it" to play.

I am author of the Unity asset u$$anonymous$$$$anonymous$$O (http://u3d.as/6hQ) which is specifically optimized for dedicated servers and uses UNet under the hood, so that you can still make use of all things and exact syntax from UNet, also using the Network$$anonymous$$anager you know from it. From next version on it will be possible to use the WebSockets as well, I have that working in my dev version already. I also provide relatively cheap dedicated but powerful servers for rent, including all kinds of assistence you could be needing with running them, file upload, security, server restarts, ect.

avatar image argentummanusbeta softrare · May 11, 2018 at 02:17 PM 0
Share

I've seen a Unity owned, online cloud server host called photon. Would that online cloud host meet the requirements of my game.

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

167 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity networking tutorial? 6 Answers

Networking for 1v1 rooms 0 Answers

What is the CCU of the default Unity Networking? 1 Answer

Can a person be both a client and a server? (and more) 0 Answers

can firebase real-time database be used on a pc standalone game? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges