The final object we need to make our game an actual game is our ball. In this section, we will create a sphere, add a couple of classes and a rigid body, apply a material, and then turn the object into a Prefab. This will be short and sweet. Let's follow the given steps:
- Start off by creating a sphere and ensuring that it is not a child of anything in the Hierarchy view.
- Rename the sphere to GameBall.
- Set its Position to 0,0,0 and its Scale to 0.07,0.07,0.07:
- In the Project view, right-click on the Materials folder. Click on Create and then click on Material.
- Name the new material GameBall and set the Albedo RGB values to 255,255,0--a very bright yellow.
- Select the GameBall material in the Project view, drag it on top of the GameBall object, and drop it:
Now we have a yellow sphere sitting on top of the camera, which we cannot quite see. Now we need to add some code and a component before we can turn this into our game object. First though, we need to take a moment to look at Tag and Layer.