Learning Scripting (Next Step)

I’ve been learning scripting, and I feel that I have a pretty good knowledge of scripting. I know things like :

  1. Variable Types
  2. Different Functions and Purposes
  3. GUI Functions, including Working Buttons
  4. HUD - Health Bar, Energy Bar, Ammo, Speed
  5. Instantiating
  6. Accessing Rigidbodies (Just a little)
  7. Accessing Variables from other scripts
  8. Basic Script Optimization
  9. If, Else If, Else…
  10. And more around this level…

Somethings I know I don’t know about are :

  1. Raycasting
  2. Arrays (I have basic understanding)
  3. Loops
  4. Enums

With that, I can write scripts such as :

  1. Shooting
  2. Ammo
  3. Movement
  4. Bullet Scripts (Audio, Damage, Colliders)
  5. Damage Recievers
  6. HUD
  7. Quitting, Pausing, & Loading Levels
  8. More…

So I have all this knowledge… what’s next? Are there any tutorials for learning advanced or even intermediate scripting? I’ve looked at plenty of beginner tutorials, I’ve read books, I’ve gone around the internet, and I haven’t found a tutorials that can cover many subjects and help me learn. At this point, what I’m doing is using Unity Answers to help me solve my problems, and I start to learn how to do things that way. I’ve gone through the Unity Manuals. What should I learn next, and how should I approach learning it? This question has bothered me for a long time, and I need to make my scripts more efficient, have improved capabilities, and even have functions that I couldn’t put in my scripts before. If you would like me to post up one of my scripts so you can gain a better understanding of my understanding of UnityScript, then ask. Thanks.

I'd say now you should try actually making a game! Try coming up with a game that you want to make, and apply the skills you've learned! I must say, you're doing things in the right order- as opposed to most of the people who post here, who try to make a game without first knowing the basics...

Loops and arrays should definitely be next on your "to learn" list - without knowing those two properly you will write horrible and time-consuming constructs that are completely unnecessary ;)

I'm in the process of making a game, but there are some features I don't know how to do, such as counting the number of enemies the player has killed, or locking on to a certain target. For example, I'm flying and I want to lock on to a target and fire a homing missile. Well I have a basic homing missile script, but it will only lock on to a target with a tag, not a specific target. I'm trying to get a better of understanding so maybe I can figure out that question myself before using Unity Answers.

2 Answers

2

Yea… one thing you haven’t listed is OOP programming. It’s not only important to know how to use the API, but also to know the basics of OOP.

  • Interfaces
  • Polymorphism (deriving classes)
  • Singleton pattern (quite important in many game projects, to have a global instance which can be accessed without having to using GameObject.Find

Since you haven’t specifically named which of the 3 languages you’re using to learn Unity development, it’s hard to give exact hints.

This below is more or less C# specific (which is much more powerful language to do Unity3D development than UnityScript or Boo)

  • Generics (i.e. using ArrayList or learning how to write your own generic methods & classes)
  • Events & delegates (delegates C# only)
  • Lambda methods (i.e. myClassArray.Sort((o1, o2) => o1.myVariable.CompareTo(o2.myVariable)):wink:
  • LINQ

Then there are of course other, non language specific stuff, but still usefull:

  • Serialization (putting values from classes into a string, xml or binary file and reading it back, useful for loading/saving games)

And last but not least (something you can’t learn from a tutorial): Experience. You will only learn to do something right by trying it out and then (days or months later) you’ll notice the flaws of your design and improve it next time. That’s something you can’t learn by reading books etc., that’s something you have to experience yourself.

I'm using Java specifically, as I've only started learning scripting about 3 months ago, and I heard that Java is the easiest to learn. Should I learn C# instead? Do yo know of any tutorials that covers any of that.

C# is closer to Java than Javascript is. Learn C#, its more powerful.

Apparently JavaScript was meant - it's amazing how many people mix up Java and JavaScript. @Tseng: A complete side-note, but it's very rare that you actually need singletons. Usually you just want to access one global instance, while singletons are for the rare case that you can't have more than one instance of it around. Some more details here.

With that you basically have one lazily created global variable (doesn't really matter wether you access it as Foo.Instance or Globals.Foo), not a need to enforce that you can only ever have one instance (i.e. private constructor etc.). :)

I'm debating whether or not to get a clearer better understanding of UnityScript before learning C#. I'm going to start saying UnityScript instead of Java or JavaScript to avoid mixing the up.

You’ve gone beyond all the Unity-specific tutorials now. You should start studying more generic programming arts such as Design Patterns, and apply them to UnityScript.

Other than that, just practice, practice, practice. That’s how every programmer gets better at what they do… That, or find a mentor.

If there are any local Unity groups, joining them can help improve your skills as well.