Bad habits you have learned to avoid when using Unity?

OK there are tips and tricks when using Unity, but what bad habits have you learned to avoid when using Unity?

What advice would you give to noobs to help them avoid making more trouble for themselves when learning and using Unity?

  • Go shallow and light on prefabs, beware the deep prefab.
  • Everything there is more than one of should be a prefab.
  • Component based scripts are good but can increase complexity and coupling as components are added.
  • Set the lowest light GI settings you can.
  • Unity events are good but slow, therefore adopting managed pools early for multiple objects.

Or how do you manage and avoid complexity in Unity?

1 Like

The biggest thing I can say is, don’t be like me and end up having 200+ near finished projects and actually finish something.

I get 95% done with a game and just stop because I don’t think something is worthy enough because of one tiny fault in design that I don’t like.

So yeah, just actually finish something, I can’t stress that enough. I’m finally training my self to do that, and I’ve actually stuck with my project, hopefully will release soon.

4 Likes
  • Use input managers instead of embedding input into different components. This way you can enable/disable inputs depending on the state of the game/player. (If the game’s in the main menu, then the “Jump” input doesn’t need to be firing.)
7 Likes

This might be a bit much for new developers, but keep in mind that game development is still software development. Unity’s great for hacking together quick prototypes, and you should definitely take advantage of that to get feedback on your idea before investing too much time.

But keep studying software development methods, too, and try to employ them rigorously in your real projects. Things like: use version control, code defensively (e.g., null checks), write your tests (unit tests, etc.) first, decouple dependencies (such as the input scenario @Stardog just mentioned), and document your code (even if you’re solo, assume someone else will read your code, even if it’s just your future self). Developing robust systems can be a rabbit hole, though. It’s easy to burn too much time trying to make a perfect, reusable system when your time would be better spent making something well-designed but purpose built for your specific game. Formal software development practices might sound like they add more complexity, but they really just add rigorousness. Complexity is a jumble of hacked-together, undocumented scripts that barely hold together with duct tape and crossed fingers.

Speaking of solo vs. team, this thought might be more controversial, but: embrace the Unity editor. If you bring on team members, especially artists and level designers, they’ll probably already be familiar with working in the Unity editor. Even if you write custom editors, they should be able to pick them up quicker than if you make them, for example, try to work with some esoteric, custom data format outside of Unity to set up scenes. YMMV on this one, though.

Good point. There’s always Feedback Friday. Evaluate early and often. :slight_smile:

6 Likes

@TonyLi : I’ve thought about doing Feedback Friday. But I have the realization you will only get answers from a developers prospective, not really a consumer standpoint. No matter how much we try, we are developers - we see things either the average consumer will never notice (1 pixel off button) lol.

I mean I’m sure it can certainly help. But I’m sure you get what I mean. We just see and notice things most people won’t notice, so we get really nit picky over slightest of things, such as ‘man it took this photo 1 milisecond to long to load’ lol.

1 Like

Good point. That’s the same issue with the TIGSource Forums. But at the same time game devs are also gamers, so they can sometimes put on their “gamer” glasses. I often bring my prototypes to local meetups. You get a totally different level of feedback in person. I’m sure there are some good meetups down your way.

1 Like

@TonyLi : I’ve been wanting to go to one. But the closest one to my area that I can find is in Atlanta, GA. (3-4 hour drive). Kinda far just to show like 10 people who will be there lol.

Login to Meetup | Meetup :wink:

1 Like

I may be the closest developer to @N1warhead_1 in Blue Ridge Georgia, two miles north of Atlanta. I have the same issue as him…300+ projects on my harddrive with what i think is some small flaw:) It is a b***h being a psuedo-perfectionist.

That’s actually further away from me haha.
I’m right near Savannah, GA. (Hardeeville, S.C.) I’m like literally 3 miles line of sight from the big bridge if you’ve ever been there.

Yeah man, I’m really bad with perfection. if something seems off, I’ll literally start the entire project over from scratch… It’s a habit I’m trying to stop doing. But I’m glad I do that, it’s taught me so much. Stuff I wouldn’t have learned as quickly otherwise.

I hear you. There’s nothing like the “peer pressure” of a group of folks who are excited to play your game in-person to push you into getting it into release shape.

@N1warhead_1 - I should’ve posted this recent article yesterday. Nicholas Laborde documented how he helped build a gamedev community in an area (Lafayette) where he thought he was the only dev: How to Build a Grassroots Indie Community. SCAD appears to have a healthy game development program, and they host an annual GDx conference. So you might have devs right down the road from you.

2 Likes

@TonyLi : I honestly forgot all about SCAD hahaha… I know they use Unity, as they were hiring an instructor about a year ago for that. I would have applied, didn’t even need a degree - just needed to be a AAA developer lol.

Ill check out the article. Thanks man.

1 Like

‘Bad Habits’ is a weird phrase; thread should be named ‘What practical advice would you give to others when learning and using Unity’

My Advice:

  1. Stop Instantiating and Destroying things frequently. Learn Object Pooling (Its super easy and will save your project (Especially on Mobile)).
  2. Have the Profiler visible at all times and keep one eye glued to it.
  3. Deploy to Target Platform(s) frequently. Don’t deploy to target platform the day before you aim to ship.
  4. Disable ‘Pixel Perfect’ from UI Canvases.
  5. Learn how to write Shaders; for Optimisation and Custom Visuals.
  6. Read these 4 Optimisation Documents on our Learn Tutorials:
    Learn game development w/ Unity | Courses & tutorials in game design, VR, AR, & Real-time 3D | Unity Learn
  7. Watch this video:
  1. Only update Unity when you need to update it (for a feature or a shipstopper bug fix)
3 Likes

Why doesn’t Unity provide a generic asset pooling system in the default assets and a tutorial on how to use it?

Also if this is good advice where is it in the Learn section?

1 Like

Like this? https://unity3d.com/learn/tutorials/topics/scripting/object-pooling

1 Like

Yes, when I click on assets in Unity why isn’t object pooling a default asset?

Because its just a C# script. An Object Pooling System could also be dependent on how you have structured your game.
Just watch the 49 Minute Video I shared with you and use the Simple and Generic Object Pooling Script that Mike makes in it. :smile:

2 Likes

But you would agree that any game with repeating elements in Unity should use object pooling, something I cannot just add into my game via the default menu options?

Maybe? Or you could write generic (Well, as much as they can be) scripts and reuse those in projects. I have my own ‘Useful Scripts’ folder that ive been building up for a while with examples and common functionalities that I use whenever I work on a side project. Most developers I know do the same thing. :wink:

1 Like

comment your scripts, even if you are the only one who ever will see them. My biggest surprise about myself in 2016 was how many times I looked at my own code and couldn´t figure out why I had done something a certain way, only to realize a week later that I had originally been a genius.

For me - Finish a game, start the next. I see comments floating everywhere about abandoned projects, and I feel the urge too, so my advice is to not allow your brain to drift to the next project until you are nearing completion of your current one. I can see why people abandon stuff mid-way because the next project is still ´perfect´ and the current one is riddled with problems that must be solved and things that didn´t work out the way you expected. It is just a case of ´the grass is always greener´… and then you get into the next project until it also has problems and imperfections… and then jump once again to the clean slate. For me the answer was easy, I just do not allow my brain to spend too much time designing the next game.

Edit: Object pooling built into Unity? It is, it is called C# There are things that are specific to game types, building it into Unity would just mean it would have to have so many options that it would take longer to set it up than it would be to just write a quick script anyway.

1 Like