Game Development Reference
In-Depth Information
Camera gizmos
When a camera is selected in the Scene tab and the Gizmo display is enabled, it
displays a frustum gizmo that indicates clearly where the camera is positioned in the
scene and what the camera can see from that view, given its other properties such as
field of view, as shown in the following screenshot:
Camera displays the frustum when selected in the Scene view
This gizmo is especially helpful to position selected cameras to get the best possible
view of the scene. However, there are times when you want to achieve almost the
reverse, that is, to position objects in the view of unselected cameras. Specifically,
you'll want to move particular objects in the frustum of a camera and make sure it's
visible to that camera. This can be tedious to achieve under normal circumstances,
because, by default, cameras don't display their frustum gizmo when deselected.
This means that as you move objects around, you'll need to continually select and
reselect your cameras to check whether the moved objects are really in the camera
frustum, and adjust and tweak their positions if required. To solve this issue, it'd be
great if Unity allowed you to view the frustum gizmo permanently, even when the
camera was deselected, but it doesn't, at least, not at the time of writing this topic.
To work around this, however, you can write a script, as shown in the following
code sample 5-1:
 
Search WWH ::




Custom Search