We will be using Unity to create a basic Driving Game with Obstacles.
The full step-by-step lesson can be found at https://learn.unity.com/course/create-with-code
We will create the project from scratch and use the models we made in MAYA and that we painted with PHOTOSHOP.
Step 1:
Open Unity Hub.
Click on Installs, make sure that the latest version of Unity is Installed.
Click on Projects > New and choose 3D
Name the Project : Driving_Game
and for Location make a folder called Driving_Game on your Desktop
Step 2:
Unity will open.
First we will create the road.
Right click in the HIERARCHY WINDOW and choose 3D Object > Quad
Use the Tool Bar (or QWERT keys) and find the Rotation (E) tool.
In the INSPECTOR WINDOW find the Transform setting for the Quad and in ROTATION type in 90 for X.
Step 3: Add Texture
In the Project Window, find the Assets folder and Make a new folder called ‘Materials’ in there.
In the new folder, right-click and choose Create>Material and name this Material ‘road’.
In the Assets folder make a new folder called ‘Textures’.
Add your image of the road to this Textures folder.
Now double click the Shader Ball called ‘road’ in Materials.
Now click on the small circle next to Albedo and click on your Road texture. Now the Shader ball should have the texture applied.
Step 4: Apply Texture
Now click on the QUAD Object in your Hierarchy. Now click on the MESH RENDERER component and in Materials find Element 0 and click on the small circle to load the ROAD image.
Step 5: Modify Texture and Size on Object
Now click on the Quad Object.
We will make the road much longer, adjust the Y scale and add 30.
Now in Materials click on the Road Shader Ball and change its Tiling Y value to 30.
Step 6: Adjust Road Location
Click on the Quad object
Use the Move Tool (W) to move the road to where the camera starts viewing.
Step 7: Test the road
In the Hierarchy window, right-click and choose 3D Object>Sphere.
Now use the move tool to drag the sphere above the road.
In the Inspector for the Sphere, add a new component that will give it gravity and motion. Click on Add Component and type Rigidbody. This will add a Rigidbody Component to the Sphere.
Now press PLAY and in the Game view you will see the ball fall and land on the road. Experiment with its placement in the sky to see how it reacts when it falls.
Step 8:
File > Save as Road_Scene in the SCENES folder.
Step 9: