In the previous two lesson, you've create a terrain in Unity and added textures and trees to it. In this lesson, you'll learn how to add wind, some rocks, a skybox, and splash of water. Off we go!
Unity Wind Zones
You can add wind as a game object. Tweak a few settings and your trees will start swaying when you play your game.
To add a wind object, click the Game Object menu item at the top of Unity. From the Game Object menu, select 3D Object > Wind Zone. You should then see a blue arrow icon appear in your scene: (If you can't see the icon, double click WindZone in the Hierarchy.)
If it's not in the correct place, use the Transform > Position values in the Inspector to reposition the arrow closer to your trees and bushes: (Don't forget to adjust the Y value to move the wind arrow up or down.)
With your Wind Zone item selected, have a look at the Inspector:
You can change the mode from Directional to Spherical. Knocking the Turbulence up will get you a good gust going.
Play around with the settings, though, and see what they effect they have when you play your game.
Get Your Rocks On
You can add rocks to your scene, of course. If you go back to the Unity Asset Store and type in Rocks, you'll get quite a few results back. There's a page here with four different types of rocks. (ROMPAS studios.) Don't forget to click on Pricing on the right of the Asset Store, then check the box for Free Assets.
If you download and install the rock pack above, you'll see there's a prefab folder with the rocks:
Simply drag and drop a rock into your Scene. (Sadly, you can't use Paint Details for most of the rocks on the Asset Store, as Unity doesn't handle them very well. So you have to manually add them to your Scene.)
Adding things like rocks really adds interest to a Scene:
You an also add flowers. There's a good free flower pack here on the Asset Store by Vladislav Pochezhertsev:
Add these flowers the same way you did for the grass. Notice that you need to change the Healthy color and Dry color from the default green:
Here's a Scene with some flowers in:
Another way to liven up your games is to change the default sky. You do this by creating or downloading something called a Skybox. These are flat, 2D textures wrapped around a cube or sphere. (They tend to be big-sized files, though.)
There's some Skyboxes you can download here on the Asset Store by Mundus:
Install the package and have a look at the Project area at the bottom of Unity. Click on the Materials folder:
To change your skybox, you need to bring up the Lighting tab. From the menus at the top of Unity, click on Window > Rendering > Lighting:
When you get the Lighting tab up, click on Environment at the top. Then click the tiny circle to the right of Skybox Material:
When you click the tiny circle, you'll see this dialog box appear:
Double-click a skybox to select it and to close the dialog box down.
That's it - job done! Test it out. Play your game and see what it looks like. With a good skybox, you can go from this, the default:
Now let's add some water. (That's not water in the scene above, by the way. It's just the dark grey background that the terrain is sat on.)
Unity used to come with some water as part of its Standard Assets package. However, Unity no longer comes with the Standard Assets, so you have to go elsewhere for your water needs.
One great free water shader is by Nicholas Veselov (#NVJOB). You can grab it here on the Asset Store (hefty download, though!).
Once you download and import the shader, have a look at the Project area at the bottom of Unity. Expand the item called #NVJOB Water Shaders V2 and click on the Prefabs folder:
Drag and drop one of the prefabs on your Scene. Play around with the Transform values to position your water:
It's just a Plane, really, with some fancy scripting. You can adjust the scale to anything you like - it doesn't have to be as big as the one in the image above. You might just want some water for a lake, for example, rather than an island. But select your Water item in the Hierarchy. In the Inspector on the right, you'll see a few settings you can play around with.
Notice that you can add that Wind Zone Object you created earlier, as indicated by the red arrow, in the image above.
Play your game and see what your water looks like:
It looks pretty good, for not much work on your part. And no coding at all!
Anyway, that ends this brief foray into Unity terrains. It takes a lot of work and effort to create great scenes (and we haven't even covered lighting yet). But you could actually make a decent living, if you got really good at it!