The most simple tutorial ever

Unity2LightspeedI am often asked how a new user can get started the fastest.

The first place I send people to who are new to Unity is the Learn section of the Unity Website. Here the new user can find links to the video tutorials, live training, documentation and the community.

If, however, this is not fast enough for you, you can try the following tutorial. This will walk you through the most basic steps needed to make a working scene in Unity and uses many of the most basic elements found in a Unity project.

  • Create a new project
    • File / New Project
  • Save the scene as “Main” in the Assets Directory
    • File / Save
  • Create a cube
    • GameObject / Create Other / Cube
  • Rename the Cube as “Player”
    • Slow double click on the cube, or single click and hit <return>
  • Reset the “Player” transform
    • The “Gear” menu to the right of “Transform” / Reset
  • Change the “Player” transform.scale.z to 2
    • In “Transform”, there is “Scale: x, y, z” so change “z” to 2
  • Create a script
    • Assets / Create / C# Script
  • Rename it “Mover”
    • When the script is created, it will automatically be ready to edit – simply change the name and hit <return>
  • Drag & Drop onto “Player”
    • Click and drag the script from the Project view onto the “Player” GameObject in the Hierarchy
  • Open “Mover” for editing
    • Double click on the script – this will open the companion application “MonoDevelop”
  • Look up “Input.GetAxis” in the documentation
  • Copy the contents of the “Update” function into the “Update” in your “Mover” script
    • Copy the code between this: 
       void Update() {
    • And the first one of these:
          }
  • Save your script
    • File / Save
  • Return to Unity & create a new script
    • Assets / Create / C# Script
  • Rename it “Shooter”
    • When the script is created, it will automatically be ready to edit – simply change the name and hit <return>
  • Drag & Drop onto “Player”
    • Click and drag the script from the Project view onto the “Player” GameObject in the Hierarchy
  • Open “Shooter” for editing
    • Double click on the script – this will open the companion application “MonoDevelop”
  • Look up “Input.GetButton” in the docs
  • Copy the contents of the “Update” function into the “Update” in your “Shooter” script*

      • Copy the code between this: 
         void Update() {
      • And the first one of these:
            }
  • Save your script
    • File / Save
  • Return to Unity
  • Create a new sphere
    • GameObject / Create Other / Sphere
  • Rename the Sphere as “Shot”
    • Slow double click on the cube, or single click and hit <return>
  • Change the “Shot” transform.scale to x = 0.5, y = 0.5, z = 0.5
    • In “Transform”, there is “Scale: x, y, z” so change  “x” to 0.5, “y” to 0.5, “z” to 0.5
  • Drag the Sphere “Shot”from the Hierarchy window into the Project window
    • This will create a new “Prefab” asset of the Sphere also called “Shot”
  • Delete the Sphere “Shot” from the scene
    • Double check you are deleting the Sphere “Shot” from the Hierarchy view, not the Project View
  • Drag the Sphere “Shot” into the “Projectile” slot on the “Player”s “Mover” script
    • The Sphere “Shot” should be in the project window & the “Player” in the hierarchy window
  • Save the scene
    • File / Save
  • Play
    • Edit / Play
  • Hold down the Arrow Keys or WASD keys to move, and the Left Mouse button to leave spheres behind

When “Playing” this game, you will notice that the shots don’t have any speed, they are simply dropped into the scene. Well! Isn’t this the perfect opportunity to jump in and find out how to make the shots move?

Follow the link above to the Learn section of the Unity website and start watching videos, taking lesson and building projects. You can also follow the links to the Unity Community and check in with the people on the forums, answers and irc channel!

* There is a typo in the Input.GetButton script and the line of code looks like this:
GameObject clone = Instantiate (projectile, transform.position, transform.rotation) as GameObject as GameObject;
The “as GameObject” part is duplicated. This line should be:
GameObject clone = Instantiate (projectile, transform.position, transform.rotation) as GameObject;

No Comments

Leave a Comment

Please be polite. We appreciate that. Your email address will not be published and the required fields are marked.