Game Development Reference
In-Depth Information
Illustration 15: The difference between world axes and camera's local space axes
To fix this unwanted behavior, we need to tell Unity to move the camera on the axes of the
world space rather than the axes of its local space, which changes when camera rotates. So our
new line 15 in Listing 2 is
Start the game now to see the difference. Let's now do something that is more exciting.
What if we change the rotation of our directional light over the time? How will this rotation
affect the shadows of scene elements? To do this we need to create a new script called
LightRotator and add it to the directional light. This script is shown in Listing 3.
Search WWH ::




Custom Search