The Camera Controller component manages panning, rotation, zooming among other things for the main camera.
When you’re creating a new map using the RTS Engine menu editor, this component is attached to an object called “MainCameraManager”.
- Main Camera: Drag and drop the main camera in the map scene into this field.
- Minimap Camera Controller: Drag and drop the object that has the Minimap Camera Controller component attached to it.
- Terrain Layer Mask: Defines the layers assigned to the terrain objects.
- Panning Speed: How fast does the main camera move?
- Input Axis Panning: When enabled, the player will be able to use the input axis defined in the Input Manager to move the main camera, the Horizontal and Vertical fields allow to enter the names of the input axis for each movement direction.
- Keyboard Key Panning: When enabled, the player will be able to use keyboard keys defined by key codes in the Up, Down, Right and Left fields to pan the main camera.
- Screen Edge Panning: When enabled and when the player’s mouse is over the screen’s edge (whose size/length is define by the Size field), then the main camera will pan towards the edge’s direction in the screen. If the Ignore UI is also disabled then when the mouse is over a UI element on the screen’s edge, the camera will not move.
- Pan Limit: When enabled, the main camera’s movement will be limited by a minimum position (on the x and z axis) defined in Min Position and by a maximum position (on the x and the z axis) defined by Max Position.
- Initial Euler Angles: Defines the initial camera rotation.
- Update Minimap Cam Rotation: When enabled, the minimap camera will initialize by having a rotation that fits the chosen initial rotation of the main camera in the above field.
- Fix Pan Rotation: When enabled, the main camera’s rotation will be fixed to the initial value when the camera moves by at least a difference defined in the Allowed Rotation Pan Size field.
- Rotation Speed: How fast does the main camera rotate (on the y-axis only)?
- Rotation Limit: When enabled, the Min field defines the minimum allowed rotation value on the y-axis and Max field defines the maximum allowed rotation value.
- Keyboard Key Rotation: When enabled, player will be only to use the keys defined by key codes in the Positive (positive rotation key) and Negative (negative rotation key) fields.
- Mouse Wheel Rotation: When enabled, the player can press their mouse wheel and drag the mouse to rotate the main camera. The Smooth Factor defines the sensitivity of the mouse drag movement.
- Zoom Speed: How fast can the main camera zoom in/out?
- Mouse Wheel Zoom: When enabled, the player can use their mouse wheel in order to zoom in or out. The Name field allows to define the axis that tracks the mouse scroll wheel movement in the Input Manager. The Sensitivity field defines the multiplier value for the mouse scroll wheel movement. Finally, the Invert field allows to invert the scroll wheel zooming when it’s enabled.
- Keyboard Key Zoom: When enabled, the key codes defined in the In Key and Out Key fields can be used by the player to zoom the main camera in and out respectively.
- Zoom FOV: When enabled, zooming will happen by modifying the field of view (FOV) value of the main camera and not its actual height (position).
- Initial Height: Defines the initial height (or initial field of view) of the main camera (when the game starts).
- Min/Max Height: How close/far can the player zoom the main camera in/out? (Also represent the min and max field of view values).
- Offset X/Z: The main camera position on the x- and z-axis will be offset by this value.
- Smooth Follow: When enabled, the main camera will be able to follow selected entities smoothly. Check out the Selection Manager for settings regarding following selected entities. The Smooth Follow Factor defines how smooth the camera follow is.
- Stop Following On Movement: When enabled, the main camera will stop following the selected entity(ies) when the player moves it.