The RTS Engine uses 4 cameras: A main camera, a UI camera dedicated for the main camera, a camera used to render the minimap and a final one used to render UI elements on the minimap. You can get rid of both UI cameras and make the main and minimap cameras render UI elements as well but that is not advised especially if you’re using fog of war and you’d like to still display UI elements on hidden areas.
In the demo scene, the Audio Listener component is placed on an object that is child of the main camera but placed at the ground terrain level. This allows audio to be picked directly from the ground terrain, where the action is.
When you’re creating a new map using the RTS Engine menu editor, all 4 cameras can be found as child objects of the “CAMERAS” object, where each UI camera is a child of its non-UI camera counterpart. Every camera has a different culling mask and therefore each object handles showing certain types of objects. Make sure that each camera and its UI-dedicated camera counterpart have the same field of view or projection size values.
- Main Camera: Culling mask of the main camera is defined as:
- UI Camera: This camera is a child object of the main camera object and is responsible for showing UI elements on the player’s screen. The UI camera’s transform position and rotation must be both set to (0,0,0). Make sure that this camera’s “Clear Flags” field is set to “Depth Only” and that it has a higher depth value than the main camera. The culling mask of the UI camera includes the following RTS Engine layers:
- Minimap Camera: This camera has an orthographic view of the whole map and its culling mask includes the following RTS Engine layers:
- Minimap UI Camera: Child object of the minimap camera. Its transform position and rotation must be both set to (0,0,0). Make sure that this camera’s “Clear Flags” field is set to “Depth Only” and that it has a higher depth value than the minimap camera.