In this article, you'll be given a beginner's introduction to Unity3D through multiple instructional videos and supplementary exercises. They should be completed in order, and it's recommended that you pause and re-watch any parts that you have trouble following.
1. Work-space Walk-through
Unity3D comes with its own environment, and this can often be overwhelming for a beginner. In this video, you'll learn how to create a new Unity project, and be given a walk-through of the various interface elements.
Take your time and explore the Unity work-space. Hover over various elements and read the tool-tips. Have a look through the documentation for more depth.
2. Creating GameObjects
Now we're going to learn two different approaches to creating GameObject in Unity. One by using the Unity graphical interface, and one by using code in a script.
Create four more cubes to generate a total of eight cubes at run-time.
3. User Interface
We’re going to learn how to create some Unity Graphical User Interface (UGUI) elements, and then use them within our scripts for various actions.
By the end of this video you will have a simple user interface with three elements:
- An input field that will expect text input from the user;
- A text component that will render text on screen;
- and button, which when clicked will copy the text in the input field into the text component.
4. Importing Assets and LeanTween
We’re going to learn how to download and import LeanTween into our Unity project, and then run a quick test to make sure it’s working. LeanTween is a third-party animation engine for Unity, which will allow us to do some interesting things with position, rotation, and colour later on.
Try adding some more GameObjects and try animating them using the moveX and moveY LeanTween functions.
5. Easing with LeanTween
We’re going to learn how to use LeanTween to apply easing functions to our GameObject animations.
Easing functions specify the rate of change over time. Objects in real life don’t just start and stop instantly, and easing functions can be used to give an animation the right look and feel.
Try using LeanTween.color (http://dentedpixel.com/LeanTweenDocumentation/classes/LeanTween.html#method_LeanTween.color) to animate the colour of a Gameobject.
Now create a user interface that applies different animations to the same cube depending on which button is pressed.
6. Execution Order
We’re going to learn about the execution order of the various functions in Unity. When writing Unity scripts the c# programming language, your scripts will always explicitly derive from Unity’s MonoBehaviour class. Scripts that derive from this class have many functions that execute in a particular order.
Extra. Create your first game
You should try to reproduce the game in the video whilst you're watching it. You'll learn how to create a game including the following:
- Importing 3D models
- Character movement
- Spawning and moving collectables
- Spawning and moving hazards
- Unity GUI
- Health System
- Scoring System (including high-score)
- Persistent high-scores (e.g. restarting the game keeps the previous high score data).