Creating 3D objects in Unity

As mentioned in the previous section, GameObjects can include 3D objects with properties and components. In this section, we will create a 3D object to represent a blood droplet that we can use when the Cucumber Man is battling with a Cucumber Beetle. Before we create the object, let's create a material so that our blood droplet can have a realistic red color. Follow these steps to create the material:

  1. In the Project panel, click Materials, and then right-click in the folder and select CreateMaterial
  2. Name the new material red
  3. With the new material selected, click the color box in the Main Maps section of the Inspector panel
  4. In the color selector window that pops-up, select a red color and then close the selection box

Your new material, when viewed in the Inspector panel, should look similar to the following screenshot:

Next, let's create the sphere:

  1. From the top menu, select GameObject | 3D Object | Sphere.
  2. Use the transform tools to position the new sphere so that you can see it in the Scene view.
  3. Use the Transform section of the Inspector panel to increase the Scale to 5 for the X, Y, and Z Scale parameters. This will help make the sphere larger and easier to work with.
  4. Next, we will assign the red material to the sphere. With the sphere selected in the Hierarchy panel and the Materials folder selected in the project panel, drag the red material from the Materials folder to the Inspector panel Mesh Renderer component, in the Materials | Element 0 parameter.

You will now see that the sphere in the Scene view is red. 

If we intend on using this sphere to simulate blood droplets, we might need several dozen of them. We will explore our options in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset