Game Development Reference
In-Depth Information
Step 9. Change the camera back to a perspective projection. Set the
FOV to 60 and the Near and Far planes to 1 and 200, respectively.
Step 10. Create a sphere game object and position it at (620,15,715).
Step 11. Select GameObject > Create Other > Camera from the main
menu. Rename it to SphereCam. This camera will become the viewing
camera automatically.
Step 12. Locate the Depth property in the SphereCam's Camera
component. If this property is larger than the depth for the Main
Camera, it will be the one that is drawn in the Game. Change the
depth for both cameras so that the SphereCam's depth is 1 and the
Main Camera's depth is 2. The Main Camera will take control again.
Step 13. Set the SphereCam's position to (0,0,0).
Step 14. Drag and drop the SphereCam onto Sphere in the Hierarchy
as shown in Figure 2.9 .
Fig 2.9 SphereCam attached to the
Sphere.
Step 15. If you try to play the scene at this point there will be an
error reported saying “There are 2 audio listeners in the scene. Please
ensure there is always exactly one audio listener in the scene.” This is
because there is an audio listener attached to all cameras by default.
As with the Highlander , in the end there can be only one … in your
game. The audio listener is the component that listens out for audio
sources in the game environment and ensures that they play at
the right volume and in the correct speakers. To resolve the error,
remove the audio listener from the SphereCam.
Search Nedrilad ::




Custom Search