Previously, we discussed how to create a terrain object– short, that is, in comparison to the time it’d take us to develop our own terrain system from scratch. The landscape created so far, as well as the workflow used to create it, together offer an insight into the awesome potential of Unity as a game engine as well as, more generally, a time-saving tool.
The problem with our terrain at this stage is not its shape, form or texturing but rather its sparseness, its lack of set-dressing or props. The terrain is desolate: it has none of the hallmarks of a real-life terrain – no trees or grass or vegetation, no flourishing verdant life of any kind. It’s time for us now to fix that issue by adding trees and grass; and we’ll also add a first-person controller to the project so we can explore the terrain as a game character would be able to do. Consider the following steps.
1. Let’s add some trees to the level. The terrain package imported earlier in this chapter already contains a palm tree mesh that we can add to the terrain. This can be found in the Project panel under the folder Standard Assets > Trees Ambient-Occlusion > Palm. one way to add the palm tree would simply be dragging and dropping the tree mesh from the Project panel into the viewport and positioning it onto the terrain surface, just as we would with any other ‘regular’ mesh file. However, this approach would soon become problematic for at least two reasons. First, terrains typically feature many trees, and duplicating a tree mesh for each tree on the terrain would quickly become tedious work. Second, the terrain elevates and has contours, and we want each tree on the terrain to be positioned so that it matches the flow and elevation of the terrain: again, we could manually position each tree using the Transformation tools, but this too would be tedious work. The Terrain tools therefore offer a solution to this problem: they allow us to use the brush workflow again to paint the meshes onto the surface of the terrain. This means we can paint multiple meshes in one brush stroke and have all of those meshes conform to the elevation. To access these tools, select the Terrain mesh in the viewport, and press the Place Trees button from the object Inspector – it appears on the right-hand side of the Paint Texture button; see Figure 4.7 for more details.