Unity: Wind, Sky and Water

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.)

A Wind Zone game object added to a Unity scene

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.)

The Wind Zone in Scene view

With your Wind Zone item selected, have a look at the Inspector:

Wind Zone settings

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.

https://assetstore.unity.com/packages/3d/environments/landscapes/rocks-hd-pack-81901#content

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:

A Unity scene with some rocks added

You an also add flowers. There's a good free flower pack here on the Asset Store by Vladislav Pochezhertsev:

https://assetstore.unity.com/packages/2d/textures-materials/nature/grass-and-flowers-pack-1-17100#content

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:

Settings for flowers

Here's a Scene with some flowers in:

A Unity scene with some flowers added

Unity SkyBox

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:

https://assetstore.unity.com/packages/2d/textures-materials/sky/wispy-skybox-21737#content

Install the package and have a look at the Project area at the bottom of Unity. Click on the Materials folder:

Skyboxes in the Project area of Unity

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:

The Lighting menu in Unity

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:

The default Skybox in Unity

to this:

A scene with a custom skybox

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 Water

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!).

https://assetstore.unity.com/packages/vfx/shaders/nvjob-water-shaders-v2-x-149916

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:

Scene view in Unity with a water shader added

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.

Water shader settings

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:

Game view in Unity showing water

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!

<--Back to the Unity 3D Course Contents Page