Emily's Hobbies

👩‍💻 Starting to make a Unity game

This year I picked up a new hobby: trying to make a game in Unity. Like most people, I've wanted to make my own game for a long time, so I've hemmed and hawed a lot on what game engine to use for years. I finally settled on Unity primarily because I use C# for my day job so it should, in theory, be the lowest learning curve. I just have to learn the quirks of the engine itself, and I can apply most of what I already know otherwise.

So far, here's what my biggest hurdles have been:

1. Finding the right tutorial (that's not deprecated.)

The consistent problem I keep running into is: Unity has a lot of tutorials. Which is good! But the part that's a problem is, they also have a lot of libraries and such that aren't exactly deprecated, but no longer the best way to do things. The big one right at the start has been reading user input.

Many tutorials you find will talk about reading input keys. Here's a snippet from the Unity 2D platformer tutorial, a sample project you can download directly from the Unity launcher:

if (jumpState == JumpState.Grounded && Input.GetButtonDown("Jump"))
    jumpState = JumpState.PrepareToJump;

It starts out the gate teaching you this is how input is read, this is how you structure your player's commands, etc. Never mind that Unity has a whole system called Input Actions which allows you to set up multiple schemas, assign them to keys, and make them compatible between mouse/keyboard and controllers. And it turns out, searching for the right tutorial that actually teaches this system is difficult, because most movement tutorials focus on the basic Input-class methods.

Knowing to use Input.GetButtonDown() isn't a bad thing, and it's simple to get your head around to it makes it easier to start learning to code - a lot of people picking up Unity are people who have little to no coding experience, so I get it. But man, even when you know what you're looking for, it's hard to find it. (Or maybe I'm dumb. That's entirely possible too.)

2. The people writing tutorials don't speak the language

Though on that note, tutorials are often written by exactly those sort of people: self-taught coders who don't know the proper terms for what they're talking about. Unity itself drives me a bit batty by not following industry standards on how to case/capitalize public properties. Maybe they have some deep meaning for not doing this, but I haven't found it yet. A minor thing, but it's certainly handy to know at a glance if a property is private or not, and that's been taken away from me.

There's also been a handful of times when, watching a youtube tutorial, the creator calls something by the wrong term or outright admits they don't know what it's called. I'm one to talk in this department, because I'm historically bad at the jargon in my own profession, but this does sometimes lead to confusion and strange explanations.

3. Refactoring - even though I'm at the start (and I know better)

Since I have experience with code and I know what it's like to do something at the start that doesn't work out later, I want to keep from creating a framework that needs to be overhauled based on what I learn later on. Part of that is inevitable, though. And part of my desire to keep that from happening is keeping me from just jumping into some pieces. Part of why this keeps coming up for me is, I'm running into a few bugs where I haven't quite tracked down what's causing them yet, so I have this hope that redoing the code entirely will fix them. Sometimes it does, sometimes it just recreates it in a new way. 🙂


At the end of the day, these roadblocks are fairly minor, but since I don't sit down to code my game very often, it has kept me from some progress. But I'm going to consider this my awkward teen phase before I really start understanding what I'm looking at here.

And! I just picked up a few sample projects to peel through. I tend to learn best when I'm deconstructing an existing piece of code and seeing what works, so I'm excited to look through these. I think they'll really help.

Once I get further along in the project I'll start sharing what sort of game I'm making, but it's too early for all of that just yet.

#2024 #game-dev #unity