WebGL Build

Is there any list with the WebGL build limitations ? thinks I should know before starting any project that requires a WebGL html5 build ?

Well, WebGL Games isn’t stable with networking (for multiplayer games) and arrow keys aren’t working on all browsers…

Mostly, WebGL Games have bigger file size compared to webplayer games, because all resources needs to be hosted onto the server.

Do you make, and plan to sell WebGL games? We, Y8 website, are buying webgl games for our players :slight_smile:

Other limitations include use of threading and access to file system features (e.g: reading files)

Also any limitation that IL2CPP imposes, which with a few caveats is essentially the same as AOT for iOS (and iOS IL2CPP is the same).

See here for an overview: http://docs.unity3d.com/Manual/webgl-gettingstarted.html .

This is news to me. Got a bug report?

@jonas-echterhoff_1 I don’t see file system access listed in that page, although i do remember we had errors when our “mobile” game code tried to access I/O stuff like Application.temporaryCachePath, etc.

Is there such a limitation? I see we do use the File class in our code so i am a bit confused :slight_smile:

You won’t get access to the real user file system for obvious security reasons.

The File class will incidentally still work, however. Emscripten backs file IO using a virtual file system based on the IndexedDB local storage API. Read this post: WebGL Filesystem?

1 Like

Bug report? Nah, i’m not a unity developer :slight_smile: With two webgl driving games we had by far, they had problems using the arrow keys on Chrome (it was using the arrow keys as browser controls (for moving the view) instead of game controls).

He’s not even a Unity developer, he’s just spamming the Unity forums trying to get people to sign up for his publishing junk.

Who is not a developer? If you refer to me, yes, you guessed good, right after I wrote that I’m not a developer.

Can you comprehend that some games needs to be published by producers? Do you understand the point of having a sponsor? If everyone was developer, where would you get money from? Strange minds you have, devs…

I do understand the point yes, and it’s not for everyone (or even most). Money isn’t really a big factor if you’ve got time and it depends on how big of a title you’re developing. That being said, you’re espousing limitations of “WebGL” games that really applies to pure WebGL and not to Unity in a Unity forum so the feedback isn’t necessarily helpful and can be confusing to some. There are networking limitations but that by no means makes it “Unstable”. And spam-vertising your services in threads where folks are asking legitimate questions doesn’t provide any benefit unless they are actually the answer to the asker’s question, in which case this is not.

1 Like

Oh, in that case, I suppose I’m not helping the developers just because I’m interested in paying money for buying their games… Oh well, it’s my fault that i’m not a developer like you, and I can’t properly distinguish the pure html webgl from the unity webgl, on a unity webgl forum… Silly me, you won.

This is related to focus. Unless you specifically give your canvas focus the keyboard keydown events will bubble up to the browser window. One solution to work around this:

canvas.setAttribute("tabindex", "0");
canvas.onmousedown = function() {
    this.focus();
    return false;
};
canvas.onkeydown = function() {
    return false;
};
1 Like

I’m simply saying, start your own thread to offer your service, don’t hijack a support thread.

Certainly worth a try… interesting through that you have to say this.focus() when the canvas is clicked… shouldn’t clicking it already give you focus? You should also probably check for the specific keycodes rather than a blanket cancellation of the event… and may want to think about using stopPropogation() and preventDefault() as means to stop event bubbling.

You can see the explanation for the code in the following stackoverflow answer. It’s workaround for specific browser behavior related to canvas. The quoted solution is the one I got to work.

http://stackoverflow.com/questions/1829586/how-do-i-give-an-html-canvas-the-keyboard-focus-using-jquery?answertab=votes#tab-top

is there any technique for reduce the file size for webgl build?