Now that we have a player, we can start creating some custom behaviors for them. Our level currently looks like a dark night, but we still want to give our players the ability to see what's in front of them with a flashlight. We will customize the FPS Controller object to fit our needs:
0
, -.95
, 0
). Because positions are relative to your components position, this places the light slightly lower than the camera's center, just like a hand holding a flashlight. Now change the Rotation value to (0
,0
,0
) or give it a slight diagonal effect across the scene if you don't want it to look like it's coming straight out:1000
, and to make the light wider, we will change the Spot Angle value to 45
. Finally, we can change the Shadow Type to Hard Shadows so the light will cause shadows behind objects that it hits. The effects are shown in the following screenshot:We now have a flashlight, so the player can focus on a particular area and relax.