The goal of this workshop will be to get you comfortable with what you need to know to get started with Unity. Unity has a ton of great resources online, some of the best out of any Game Engine which makes it really great for beginners, so I think that all of you will be able to use this workshop as a stepping tool into the world of Unity and start learning on your own.
There might be an advanced Unity workshop in the future, where we will cover some really useful, but a bit more complicated concepts. It will definitely be good that you work on some projects yourself, and definitely follow some tutorials online.
(A bit random, but it's good know what what is out there. Unity is definitely a good place to start imo.)
Giant list of tools
Because this school is so Java heavy, we will be using C#, which is very similar to Java.
*Change layout to Default. (upper right hand drop-down)
*Make MATERIALS, OBJECTS, SCRIPTS Folders in Assets folder.
#Naming and organization will save you time in the long run. It's a good idea to constantly make access to your assets as easy as possible.
*Save Main Scene in the Assets Folder.
Next, Lets add our floor. For this, we can use a Cube, located under GameObject - 3D Object.
Every object in your game is a GameObject. Components can be attached to GameObjects. The most basic Component, the Transform Component (which is attached to almost every GameObject) has the position, rotation and scale information of the object relative to the Scene.
*GameOBject - 3D Object - Cube
***We will learn more about Components later on.
The first thing you will notice when you create a project in Unity is just how visual everything is. This is an engine that focuses a lot on simplifying the game development work flow. The Unity Editor makes that apparent.
Lets make the Cube GameObject into a floor. We will be using the GameObject's Component - Transform (Located in the Inspector). *Name GameObject "Floor" *Change the scale to 20, 0.5, 20 *Change the Y position to -0.25 (Just so to lower it to the ground of the World) ***Show how selecting an Object lets you use the Toolbar tools to manipulate the object. *You can add a wall and a second floor, to spice things up.
Scroll Wheel (Zoom) Hand Tool (Click Scroll Wheel) - Orbit (Hold Alt and Click-Drag) - Zoom (Hold Alt and Right Click-Drag) FPS View - Right Click-Hold and WASD
*Click on the Camera (Notice the Camera Preview that pops up) We can now use the Toolbar to Translate, Rotate, and Scale. *If you want the camera to follow a GameObject, a really easy way of doing this is to make the camera GameObject a "child" of the object you want it to follow.
*3D GameObject - Cube. Position at 0, 0.5, 0. Name "Player"
*Add GameObject - Light - Directional Light *In Inspector - Light Component - Color: Change to any color. *Note: Bias
*Right click on "Materials" folder - Create - Material
#Lots of different kinds of shaders... You can even create your own (if you are into that kind of stuff)
*Name material "Player". This will be used for the player's color. (You can also add materials for the Walls, Floor, and other things)
*select Shader - Mobile - Diffuse (simple one)
*Change color to anything.
*Now drag and drop the material (from it's icon) onto the Player GameObject. (So easy!)
***We will need to add 2 Components to our GameObject: The Rigid Body Component and the Box Collider Component.
*Go to the inspector of your object, and all the way at the bottom, click Add Component - Physics - Rigidbody
#This will enable our GameObject to act under the control of physics, like gravity.
We will need the "Box Collider" Component which is a hit box that will detect when the Box Collider collides or hits another object in the world.
*We will use this Component to check to see if the player is touching the ground (controller.isGrounded() in the script)
***If we have a Rigidbody with Gravity, we must have a Box Collider or our GameObject will fall right through our Floor GameObject.
*Scripts are Behavioural Components that you can add to GameObjects.
We will be using a script (that we will add as a component to our Player) that has all of the logic for the Player movement.
#In our script PlayerMovement, we will get some keyboard input.
*First, we must set up some stuff in the Input Manager under Edit - Project Settings - Input
*Here we can set up the directional input (Up, Down, Left, Right). We could also add a "Jump"" input.
#We will use this for event driven components in our code.
Note: "Horizontal", "Vertical" and "Jump" axis set up in Input Manager can be used with GetButton and other methods.