laptop on table

Things I discovered about Unity as a web developer

I’m a web developer learning Unity. I’ve made a few games now, but I still find working with Unity totally different to working with web. Here’s what I’ve discovered so far: 

Creating a UI is totally different

Unity’s UI is kinda cool at first glances, it has these anchor points which make it a bit like the CSS way of doing position: absolute. But it’s even better than that because the text scales to fit the area, like an image would on the web. That is something I’m really jealous about, and I wish it was a CSS property!

But other than that, there’s many reasons why I wish I could use CSS. Creating multiple buttons for example means being very specific, and making a change to one (the hover colour for example) means changing them all, which is time-consuming and feels stupid after I’m used to cascading all styles in CSS.

Also, the UI is in 3D. Nobody prepared me for that!

3D unity UI

There’s no such thing as responsive breakpoints

Well, not out of the box anyway. I’m used to creating websites that look very different on mobile, tablet and desktop, whilst keeping the markup the same for each. Unity doesn’t work the same way. Sure, you can your interface down as a percentge of the screen, but there’s no break points where the layout can totally change if it’s below a certain size – unless you have different interfaces and hide/show the appropriate I suppose, but that seems like lots of effort.

The community is just as great as web

Because web is all open-source, the community is great, people help each other, and people seem to enjoy packaging up their code for others to use and learn from, and create useful tools for the community to use. It’s really great. The same is true for Unity, the asset store has many freebies that people have created to help others get a leg-up or to fill gaps that Unity itself hasn’t plugged yet.

There’s also tonnes of free assets you can find, that make creating a game easy (stupidly though, I’ve ignored all these and wasted time trying to made my own. What an idiot!).

The community can be real dickbags

There’s this weird elitism in the community which I’ve noticed in the Unity Facebook group, and on Unity Answers. I’ve seen people get torn to shreds after posting basic answers. It’s really not nice, everyone has to start somewhere, and sometimes asking obvious questions is how you encounter some new method you wouldn’t otherwise known about.

Other times, responses have been “Google it”, which to me seems ridiculous. Applicable sometimes, if an answer is so widely known, but usually a n00b is asking experts because they want expert advice. I’ve had it thrown at me after asking for opinions on best ways to tackle a problem. I know I can google for documentation, but I’ve asked experts because I want more than that, I want a discussion.

There’s no jQuery

By “jQuery” I mean a really cool and easy way to target elements on the screen, like all buttons with a certain class, or target something else with the same parent as something else. jQuery is just magic (I know it’s hacky, but it’s useful!).

People don’t seem to be so forthcoming with their code

I’m used to seeing many completely open-source web projects, with entire codebases open for the public to view on GitHub. It’s less like that in the Unity community, and it feels like many people are more secretive about it. I suppose because many people would prefer to release their code through Unity’s asset store, so they have the option to charge money for it if it becomes popular.

People don’t seem to use GIT

I get the impression in web community that if you don’t use GIT, you’re old-school. Git is cool, it’s what the cool kids use, and to have your project on GitHub is essential. I’ve got my project on a public GitHub repo, but that seems rare tbh. Most people I’ve spoken to either don’t use version control, or use something old-school like Subversion – which seems horrible on Mac because I can’t find a decent client.

JavaScript seems to be a 2nd-class citizen

In the web community you can’t seem to get far without using JavaScript. In fact it seems to be used more and more, with jQuery being a staple, and now frameworks like React & Angular being used as a platform for the entire website. JavaScript has even made it’s way onto the server with NodeJS, and it’s being used for package management with NPM.

So it seems weird to me that whilst the web community is embracing JavaScript, the game community seems to be doing the opposite. You can code in both C# or JavaScript in Unity, but most people seem to prefer C#. It’s what most tutorials are written in, and if I post on forums for help, the assumption usually is that I’m writing in C# also. I hear it’s because it’s easier, faster, better, more efficient. But for me I’d prefer to stick to what I’m used to, and to learn something that’s more useful for my day-to-day job.

Most people seem to prefer Windows to Mac

Most of my life I’ve been on Windows, but over the years the need to have a Mac became more obvious. A Mac is closer to the operating system running on the servers, so it’s closer to the final environment, which makes it easier. It especially makes it easier because I was in a team where the majority of people had a Mac or Linux, and it just became a no-brainer. I didn’t want to be the exception, and I especially didn’t want to have to create complicated workarounds.

So I got aMac, and I got used to it, and in my new job I was given a Mac also, and I’m very happy with it. I’ve got problems with some of the UI choices (see here), but more or less it’s solid and doesn’t often break in the way Windows does – and most importantly, it doesn’t force updates, which close down all my running programs. That annoys me so much!

But weirdly, the industry of game development seems to be the opposite. I assume because Windows has a heritage of games that Mac doesn’t, and therefore has more tools, and support, and it’s just what the majority of people use.