Seeking feedback on my first attempt with Unity.

Hey.

A few weeks ago I decided to give this whole game making thing a go. Since then I’ve been learning Unity. I began with what I imagine is a popular first project: Pong.

I got this up and running pretty quickly, within a couple of nights of tinkering I had a functioning pong game. However I wanted to learn as much as possible along the way, to which my method was reading some new aspect of Unity or C# I hadn’t heard of before and figuring out a way to implement into my project.

So without further ado here is my project: http://www.filedropper.com/mofunklespong

Any help would be appreciated here in someone looking over it to see exactly how I did, as at the end of it, I’m not entirely sure. It works, which from what I gathered is a good start. However as I was going through so much so quickly I’m not sure how well I implemented them. Now I would disclaimer this with this is pretty bloated for pong, mainly due to the aforementioned method of using the latest thing I’d learnt.

However there are a few things that I wasn’t 100% confident about. This was either down to me not really understanding why I would want to ever use it or reading contradictory information online about whether they were the right thing to use or not.

I’ll talk about my experiences with each part of my project and how I got on with them and the parts of them I didn’t understand, so any feedback here will be much appreciated.

C# Scripting
So I had a lot of fun with this. I think the programming side is what I enjoyed the most. Early on it was obviously confusing with all the references to transforms, translates and such. But I got into it and slowly those things began to click into place so I knew why and when I would be using them.

So as above with the method in my learning in this project, I would read a Unity scripting tutorial then figure out a way to implement what I had just learnt. For the most part this was pretty straight forward. However a few things I didn’t quite understand.

For instance. I read that using co-routines is preferential to using the Update() or FixedUpdate() methods. I re-wrote a lot of my project’s code to remove all use of those methods and put everything into co-routes. So I kind of get that co-routines tend to be temporary, so this would be an optimization to have various aspects of the code not running constantly. However I found that some co-routines I made just needed to run constantly. Now is this down to me not finding an adequate temporary solution? or in this instance are the Update() and FixedUpdate() methods okay to use?

Classes was one I found a bit baffling. Now I get the syntax of them and that the scripts are classes, which is where I got confused. When would I ever need to nest my own class within another class as opposed to just making a new script? I couldn’t figure out any instance within my project where that would be necessary or even why I would want to do it at all.

Enums I still haven’t figured out where to use. What are these used for? again, like classes, I get the syntax of how to make them and use them, I just don’t get why I would want to. If it could be pointed out to where in my project an enum could have been used in some fashion it may better help me understand what that is all about.

I did read the ‘Good Coding Practices’ article to. Now I do think I fell foul of this. A lot of my scripts I felt either turned out bloated or perhaps a little jumbled up in purpose. So any feedback on where I could have improved along these lines would be much appreciated.

But yes, coding is something I could definitely get into. Like when I learnt ternary operators? holy crap. That felt life changing. Was a lot of fun going through my code to find all manner of places to use those. Co-routines I think I only scratched the surface of but I feel those could get a lot fun to play around with further.

I’m still working on the intermediate level tutorials and straight away those felt a lot more taxing and maybe a bit too convoluted for pong. So that’s why I’m making this thread now, to draw a line under that project, begin a fresh, more difficult project and perhaps make use of these more advanced coding features. I also started finding tutorials for procedural level / maze generation which I want to give a try, so I don’t know. Any suggestions of a good follow up learning project from pong?

UI
This was something I felt like every step of the way I was just doing it wrong. It worked. But I read that using multiple canvases is a bad thing, yet the only way I could figure out how to make menus and menus within menus etc was with different canvases for each. Without it felt like it would be a very clunky way of enabling or disabling different UI elements individually. So any insight there would be great.

I tried out a bunch of things here however. I made my first custom class to handle a fade in/out effect. I tried to introduce some kind of permanence with options.

The main place I felt I was just making things harder for myself was in how I handled which menu was open and how to respond to pressing the ‘esc’ key depending on that. I use a variable to track a kind of menu level, 0 being not in the menu at all and then a switch statement to make the cases from that. That however felt very fiddly and with a more complicated menu would quickly become unmanageable. So any advice on that in particular would be awesome.

Objects & Textures
I had a crack and making my own texture. Which is including the project. I’m not sure this aspect of it is for me however, as after going through a few Blender tutorials I just don’t like that program or really anything about the artistic side of game creation.

Plus I had a lot of issues with different maps. I couldn’t understand why my specular maps for instance where colouring my texture and darkening it in the places where the light was supposed to catch it. So I abandoned using those.

I was going to make custom everything for the game but it just felt like learning that side of it was going to become extremely time consuming and take away from the coding part I was actually enjoying. In future I imagine I’d just use the asset store for this side of Unity.

Thanks in advance!
So that is my first project I guess! I’m not sure what to make next to learn more of Unity. I’m thinking of something along the lines of a tower defence game. But thanks to anyone who has taken the time to read this and look over my project!

Welcome to Unity. It’s nice to see a first lots that’s not “help me make an MMO”

Update gets a bad rep because any code in it is called every frame. However if you are going to use a coroutine to execute something every frame you might as well use Update.

Nested classes aren’t all that useful. The main use for a nested class is if you want to make a class that is only accesable to the outer class. It does come up occasionally, but not that often.

Enums are used for discrete data. WeaponType {blunt, piercing, slahing} kind of stuff. Enums are entirely a convenience feature for developers, much more readable then passing around ints.

And finally it looks like you have discovered the difference between an artist and a coder. There are few people who can get really good at both, and this is the reason two man teams are popular amongst indies.

I think an MMO might be a touch above my wheelhouse. Not that I don’t have that idea for my golden ticket project, but I’m planning on spending the next few months just learning as much about Unity as possible before even considering attempting it.

Thanks for the response. I think before I start a new learning project I’m just going to do some more general C# tutorials to get some of the more advanced concepts down.

That is a good idea