Adding water

Our next step is to add the water surrounding our island. We do not intend to swim in the water or have objects in it, so we can get by with a simple approach. We will refine our water in Chapter 6, Creating and Importing 3D Objects for Our Game.

Perform the following steps to create a material and a water plane, and then apply the material to the plane:

  1. In the Project panel, click the Assets folder.
  2. In the right section, right-click and select Create | Folder. Name the folder Materials.
  3. Double-click the Materials folder you just created.
  4. Right-click in the Materials folder and select Create | Material. Name the material temp_water.
  5. With the temp_water material selected, click the white color box to the left of the eye dropper icon in the Inspector panel:
  1. In the Color dialog window, select a blue color for your water and close the dialog window. You should now see your color selection indicated in both the Project panel and the Inspector panel:

Now that we have our material ready, let's create a GameObject to simulate our water. Follow these steps:

  1. Select GameObject | 3D Object | Plane from the top menu.
  2. Using the transform tools, increase the size of the plane to match the size of the entire game world.
  3. Raise or lower the plane until it looks similar to this:
  1. With the plane selected, click the small circle to the right of Default-Material in the Mesh Renderer section of the Inspector panel. The following screenshot shows that section:
  1. You should now see the Select Material dialog window. Select the temp_water texture you created and close the dialog window.
  2. In the Hierarchy panel, right-click the Pane object and rename it WaterPane. This will help us stay organized and enable us to identify our game objects.

Your game environment should now look something similar to this:

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

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