Making Web Sites using Unity 5.0 WebGL

I want to use Unity 5.0 WebGL to create site for game.

Pros:

  • I can use .Net C# for site coding
  • I can test and debug site inside Unity editor using Visual Studio
  • site can have 3D elements

Cons:

  • site can have big loading time because of I think around 10Mb of engine code translated to asm.js

How you think about it?
Can Unity WebGL become new .Net/C# web development platform?

For websites, I think is not a good idea to enable WebGL at all, just because maybe do not everybody got WebGL support. ( not counting the loading time at all)

For browser games, WebGL will be the future. But not only Unity is doing WebGL, there are a lot of middle-ware doing that or focused only on that. Take a look at Turbulenz Engine (totally free and opensource) for example, they do pure javascript with typescript support, asm.js is just a file, probable you talk about emscripten, and thats other story. Emscripten generates javascript from C/C++. (there are other tools also who can generate javascript from various languages)

1 Like

As a web developer, let me just say…

NO NO NO PLEASE NO

DON’T DO THIS

  1. Remember the last time you saw a website made entirely in Flash? It was awful, right? This is what happens when you try to make websites with multimedia tools.
  2. You get no SEO out of the deal. Believe me, in this world, you need SEO
  3. It will only work on the absolute latest browsers. Want to reach ~30% of the world still using some version of Internet Explorer? Or whatever ungodly percentage are looking at your site on a mobile device? Forget about WebGL.
  4. Sticking with one tool in all situations simply because already you know it is generally a bad idea, because there’s almost always a better tool available. Real programmers use the best tool for the job, even if they have to learn it first!

As for the potential advantages you mention, they are completely possible in the normal HTML/CSS/JavaScript stack without trying to stretch a game engine to build a website:

  1. There’s lots of tools that will translate C# into JavaScript: Script#, JSIL, and SharpKit are just a few. In addition, there’s TypeScript, which is sort of the lovechild of C# and JavaScript.
  2. The modern Web workflow is actually significantly better than Unity’s. If you set it up right, you can see immediately your changes in the browser as you’re typing, or at least every time you save. I wish Visual Studio’s debugger was more like Chrome’s. If you really still want to use Visual Studio, though, the TypeScript plugin for Visual Studio will let you debug there as well.
  3. I’m just gonna leave this here.

As for the question if using Unity to design your web page makes sense, people have given some valid reasons against it, though i guess the answer depends on what your web page is. If your web page is ā€œjustā€ a game, then it is a no brainer.

Anyways, I’d chime in on this one:

10 MB is probably a bit on the high side. The exact size of the code depends on your project and your scripts, but here’s some code sizes from stuff we’ve tried (sizes are for gzip compressed js):

Dead Trigger 2 Demo: 6.9 MB
AngryBots: 3.8 MB
Simple ā€œFlappy Birdā€ style game: 2.4MB

(These sizes reflect JavaScript code only, not assets)

I’ll be making my website in it I’m 73.333 percent sure, though it will be a interactive game website not like a normal website.

Yep I’d love to be able to do something like this - http://acko.net/

If you don’t want organic search traffic and you can get traffic other ways (e.g. video, article sites, social sharing etc) then it may be okay to not worry about the organic part.

You’d probably want fallback pages. Would it be difficult to redirect the search engines to them as well?

use web frameworks for webs and game engines for games and you will be happy.

Can’t say Unity is only meant to be a ā€œgameā€ engine. It can do a lot more than that :slight_smile:

With enough effort, Unity can make pretty much anything. But then again, with enough effort, I can use a screwdriver to pound in a nail. Learn to use the right tool for the right job.

The WebGL export will be fantastic for highly interactive 3D content in the browser. Imagine you’re on an ecommerce site, and instead of an image of a product, you see a full rotating 3D model. Although maybe Unity would be a bit overkill for that? A basic understanding of Three.js (which is open source by the way) would get you the same result. I’m just rambling now, sorry, I’m gonna go away.

I would say the ā€˜using a screwdriver to pound a nail’ analogy is a false one. After all, I was making the argument that Unity could be the ā€˜right tool’ for that job.

ā€œcouldā€, anyway… I’m not saying that it would be the best tool for any website type out there, of course. I’m just saying that just because it’s a ā€œgameā€ engine doesn’t mean it can’t be used for other things.

What about making a web page VR ready, so if someone logs onto your site using a VR headset they enter a Virtual Space? Wouldn’t this take a game engine level toolset to produce a good effect?

Note with WebGL and VR HMD detection this is just around the corner, if someone has not already done it.

Once Unity WebGL is out, would a website made with WebGL still be as awesome? I wonder if it will start popping up everywhere… a few months ago I was looking into WebGL for a website but never got in to it much, but I’d do it in Unity (Just cause then there’s no learning curve)

There are a number of WebGL game engines popping up but what I found more interesting was the need for a 3D web standard. For example it takes a lot of code to get a simple cube to appear, what if you could just write a line of standard 3DHTML to display a 3D cube or object?

WebGL is web 3.0

You can bet your bottom dollar that I will be making websites with unity. Such an amazing competitive advantage to integrate your game and designs with .net web services and database connections all wrapped in an unlimited 3d interface…This is the future.

1 Like

Just as a portfolio piece it would be worthwhile doing. However, most large website design companies made full flash websites to show what they could do and to enter awards. An award would bring in business, a good flash site showcasing design skills etc would help as well. The fact that once a customer had signed up most professional web companies would then recommend against using flash and talk about clean design principals does not negate the obvious selling potential of flash for these service companies.

3 years have passed. I want to know if charmandermon is actually making websites in Unity?

1 Like

When Building a website… Notepad > Unity.
When building a game… Unity > Notepad.

1 Like

I have used Unity daily for the past year and am not making games.