1

enter image description here

I am working on a multiplayer game for WebGL platform and i am using (http://lockstep.io/ - SocketIo & node.js server ) for handling the game.

I am facing these issues as shown in the attached image.

I have no idea about what these errors state?

I don't think that the issue is from my coding side as my multiplayer game runs perfectly in standalone builds with more than 4 instances of the standalone build.

But it does not even open in my WebGL build.

Does WebGL does not support threading??

Please guide. What are these errors all about? Can these issues be solved?? or Do i have to change my whole project implementation?

2
  • Would be nice to go back to all your questions and accept those answers you said "thank you" or the answers that solved your problems. There are many of them. If you don't people wont answer your questions. Commented Apr 1, 2016 at 12:15
  • I did not get what you are trying to say. Was i rude? Sorry if i did something wrong. Thank You for commenting Commented Apr 1, 2016 at 12:23

1 Answer 1

2

Unity WebGl does not support Multithreading. Although Unity is working hard to bring Thread support in WebGL.

Do not compare standalone with WebGL because many features are not supported in WebGL. Looking at the error, it says something about Thread and that could definitely be the problem. About 90% chances it is the problem.

You cannot solve this problem right now unless you remove the use of SocketIo.

I don't know how SocketIo is implemented so I can't tell you if Thread is the only problem it has but if it uses other API's not supported in WebGL, then you will still have problems.

The only known network API that is made and optimized to work with WebGL is the new Unity web API called UnityWebRequest. You have to modify your code to use that. The link I provided provides many examples needed to get started with it.

if you use anything like webrequestm System.web or socket, WebGL will crash. UnityWebRequest is the only solution. It is faster than WWW and you need Unity 5.2 and above to use it.

Sign up to request clarification or add additional context in comments.

8 Comments

Thank you. I will look into UnityWebRequest I don't know whether i will be able to modify the socket io code. Let's see.
That's the only option.To use something else other than SocketIo until they fix their API. SocketIo does not even mention WebGl support on their website, so that is a big sign that it doesn't work with WebGL.
I am facing the same issue...Can you suggest how to replace socket object via UnityWebRequest.
@vikky The link I provided about UnityWebRequest has many many examples. Just scroll down on that page and you will see many examples.
@Programmer actually I have a code of github.com/vovacooper/Unity3d_MQTT. this code use system.net.socket object , which create issue in WebGl....Now my task to change the code ,So that it would be perfect run on WebGl.So my Idea is to change the object socket from UnityWebRequest will solve the issue.....
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.