Ask HN: Is it possible to use Unity on the web in 2018?
We are testing with a 2D picure of a lama. Why would it get stuck?
I can't stop myself from thinking that WebGL is being purposily boycotted by Apple and Google, because I have a powerful phone that does very complicated and CPU-intensive stuff and I can't believe it struggles with a picture.
This is the URL: http://countryfortress.com/LamaExampleWebAssembly/
[+] [-] jonasechterhoff|8 years ago|reply
[+] [-] nkkollaw|8 years ago|reply
I understand what you're saying. Of course, we're aware of the overhead compared to just including an image with a HTML tag, it was just a test to see if we could make the thing work with the minimum amount of complexity possible.
For us, it's not important to support mobile browsers: the latest desktop browsers would suffice. However, we can't build for the web without a 10-second delay before the image is shown.
What we're looking to achieve is to use Unity for native games as well as very simple animations for the web (a 2D landscape with parallax, at the moment), so that we have only 1 editor, and 1 technology to learn.
I'm also not the person who will actually build the product, I'm just helping out with research and I'm not extremely familiar with WASM and similar. What is a JavaScript release build? Is that a way of exporting the project that would allow us to eliminate that 10-second delay?
[+] [-] brettkromkamp|8 years ago|reply
[+] [-] Kiwikwi|8 years ago|reply
Per the manual: "Mobile devices are not supported by Unity WebGL." (https://docs.unity3d.com/Manual/webgl-gettingstarted.html)
You're not just rendering a picture, you're running a full-fledged high-end game engine, in JavaScript (meaning a ~50% slowdown), and using that to render a picture. It is to be expected that even high-end phones will struggle with that.
Unity WebGL is intended to be used as a frictionless way of distributing games to desktop users (think sites like Kongregate). On mobile, the respective app stores arguably already provides a similarly frictionless distribution option... so just build your project as an app.
Alternatively, you can look into lightweight engines that specifically target WebGL. These will usually run just fine on mobile, though they obviously don't offer the same feature set as Unity.
[+] [-] nkkollaw|8 years ago|reply
I'm wondering if we can optimize the full-fledged high-end game engine so that some components that are not used are not loaded.
[+] [-] Dryken|8 years ago|reply
[+] [-] nkkollaw|8 years ago|reply
By "webgl-first" you mean three.js or D3? We use Unity for iOS and Android, and we were looking to use a single tool for everything (if possible, of course). Is there any way to turn a simple Unity project into something that won't bring the browser to its knees?