Objective: Create platforms, player, and collectables for a platformer game.
Create a new Unity 3D project using Unity Hub, current version is 2020.3.17f1 at time of writing. Open Git Bash for the new Unity project folder. Create a git repository (repo) for the game on Git Hub, initializing the Unity project with git init. Connect to the repo using git remote add origin gitrepolocation. Pull from the repo by renaming master to main with git branch -m main followed by git pull origin main. Rename the scene Level1, and right click in hierarchy window to create a 3D object > cube, renaming it Platform. Make sure the position is set to X 0, Y 0, Z 0. Adjust the X scale to 5, so that it is a cuboid, as seen above. In the project window create a new folder called prefabs within the Assets folder. Drag the Platform into the prefab folder.
Duplicate the Platform in hierarchy four times, Ctrl+D, and position them using the Unity move tool so that the player will need to jump from platform to platform. Create a empty game object, calling it Environment, to organize the platforms. Drag the platforms into the Environment.
Next create a 3D object > sphere, named Collectable. Make sure the position is set to X 0, Y 0, Z 0. Make sure the sphere collider has is trigger checked, and add a rigidbody, which will be needed for the player to collect them. Make sure that the rigidbody component use gravity is unchecked, so the collectables will hover. Drag the Collectable into the prefab folder.
Duplicate the Collectable two times, Ctrl+D, and position them using the Unity move tool so that they hover just above Platform (1–3).
Create a 3D object > capsule, setting the position to X 0, Y 0, Z 0. Rename the capsule Player and change the tag to Player using the drop down. Using the Unity move tool position the Player above Platform.
The basic elements of the platform game have been created and are awaiting C# scripts to define their behavior in game. Save the Level1 scene in Unity. Finally, use git commit -m “initial commit” and git push origin main to back up the project.