Bugs and Fixes for Beginning 3D Game Development with Unity by Sue Blackman with Unity 3.5

Please note: All bug fixes are correct using Unity 3.5 to the best of my knowledge.

Chapter 4: Terrain Generation: Creating a Test Environment

No Shadows Cast  by Trees in Baked Lightmap

As you proceed step by step it asks you to create a directional light over the terrain.  Later on it goes through the steps for baking a light map of the terrain.  This is a pre-rendered version of the shadows in the terrain that allows you to use shadows without having to create them in real time.  When I created the light map it did not bake in shadows for my trees.  Eventually I googled the problem and found someone with the exact same problem, from the same book on the unity answers site (http://unity3d.qatohost.com/questions/163591/trees-has-no-shadows-baked-shadow.html)  In short, the default setting for the directional light is not to cast shadows.  Here’s what you do to fix it on Unity 3.5:

1. Highlight the directional light in the hierarchy

2. From the menu entitled Shadow Type change ‘No Shadows’ to either ‘Hard Shadows’ or ‘Soft Shadows’.

3. You will see a warning saying ‘Realtime shadows require Unity Pro’. Ignore this.

4. Re-bake the light map and you will see tree shadows baked in.