Adding trees

Hills typically aren't just grass. Vegetation can be used to block a player's visibility and give a better look to our environment. Perform the following steps to add tress:

  1. From the Project tab, go to the Assets/Terrain Assets/Trees Ambient-Occlusion folder and drag and drop a tree into the world (I'm using ScotsPineTree).

    By default, these trees do not contain collision information, so our player could just walk through it. This is actually great for the areas that the player will not reach, as we can add more trees without having to do meaningless calculations. But we need to stop the player from walking through them, so we're going to add a collider.

  2. To do so, select the tree, select Component | Physics | Capsule Collider, and then ...

Get Building an FPS Game with Unity now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.