Game Development Reference
In-Depth Information
Why?
By rotating the First Person Controller to 0,0,0 we are orienting the
controller (and thus the camera) in the direction that the spotlight will
be in when it's created. By pressing F on the keyboard when the Main
Camera is selected, we focus on the Main Camera, which means that
when the spotlight is created, it will match the position of the Main
Camera. It just takes a minute to do these things but is much easier than
creating a spotlight somewhere in space and then attempting to get it
positioned and rotated correctly.
Step 15: Add a Flashlight cookie to the Flashlight. A cookie is a sort of
texture for a light source. Unity ships with a few easy-to-use cookies.
Choose Assets>Import Package>Light Cookies. After completing the
import process, there will be a new folder in the Standard Assets folder
called Light Cookies. In the Hierarchy panel, select Flashlight and then
drag the Flashlight cookie from the Project panel into the Inspector and
into the Cookie input field of the Light component of the Flashlight.
Step 16: Test and adjust the light settings to taste ( Figure 14.10 ).
Figure 14.10 Flashlight with cookie.
Tips and Tricks
Let the flashlight remain a bit dim. This part of the game should be a bit
spooky. The way that the flashlight is set up now is that when the player
looks around, the flashlight goes with him, which works great. Don't
worry about any shadows (although they would be creepier). At this point
we should be using Forward rendering (Edit>Project Settings>Player) and
thus we won't be getting real-time shadows anyway. The shadows would
be directly behind objects and tough to see in many cases, so leaving this
flashlight as a very light (not a lot of resources needed to make it work)
instrument will work great for as long as it's needed.
Search WWH ::




Custom Search