CAMERA VARIABLES
The tables below indicate the requirements for the Simulation Variables that can be used to get and set the different properties for the available game cameras. For information on the units listed for each variable, please see here: Simulation Variable Units
NOTE: When Microsoft Flight Simulator is running in multiplayer mode, only a small number of variables are communicated between aircraft. Those variables that are available will say so in the description as being either for "All Aircraft" or for "Shared Cockpit".
You can find a complete index of all available SimVars here: SimVar Index
Cameras
Simulation Variable | Description | Units | Settable |
---|---|---|---|
CAMERA GAMEPLAY PITCH YAW:index |
Returns either the pitch (index 0 ) or the yaw (index 1 ) of the current gameplay camera. |
Radians | |
CAMERA REQUEST ACTION |
This can be used to have the currently active camera perform a predefined action. Currently only 1 action is supported, but more may be added over time. |
Enum:
|
|
CAMERA STATE |
This can be used to get or set the camera "state", which will be one of the listed enum values. Note that not ALL possible enum values are shown, since some values are internal only, and some values will do nothing, but have been reserved for future expansion of the camera system. Also note that the value "9" is a special case, generally used only when working with in-sim panels and is used to go to the showcase cameras, defaulting to the last selected camera within this section (Drone, Fixed or Environment). |
Enum:
|
|
CAMERA SUBSTATE |
This variable can be used to get or set the camera "sub-state". The options here are generally only required when working with the in-sim panel UI. Note that the "locked" and "unlocked" state will be changed automatically if the following SimVars have their values changed: COCKPIT_CAMERA_HEADLOOK , CHASE_CAMERA_HEADLOOK . |
Enum:
|
|
CAMERA VIEW TYPE AND INDEX:index |
With this you can get or set both the type of view for the current camera, as well as the option index, which will be between 0 and the maximum index value (as retrieved using the
Please see the Notes On View Types And Indices section below for more information. |
Enum (
or Number ( |
|
CAMERA VIEW TYPE AND INDEX MAX:index |
This variable can get the number of option indices related to a specific camera view type. The index value supplied to the SimVar should be one of the camera view type Enum values (see
Please see the Notes On View Types And Indices section below for more information. |
Number | |
GAMEPLAY CAMERA FOCUS |
This gets/sets the focus for the camera zoom, which can be either manual, or auto. The setting affects both the Cockpit and the External (Chase) cameras. The following SimVars can be used to get/set the level of zoom: COCKPIT_CAMERA_ZOOM or CHASE_CAMERA_ZOOM . |
Enum:
|
|
IS CAMERA RAY INTERSECT WITH NODE |
This SimVar is used to check for a collision along a ray from the center of the user FOV and a model node. The available nodes that can be checked using this SimVar must be previously defined in the [CAMERA_RAY_NODE_COLLISION] of the cameras.cfg file. The SimVar requires a node index value between 1 and 10, corresponding to the node defined in the CFG file, and the SimVar will return 1 (TRUE) if there is a collision along the camera ray or 0 (FALSE) otherwise. You may also supply an index of 0 to perform a collision check for all defined nodes, in which case the SimVar will return 1 (TRUE) if there is a collision between the ray and any of the defined nodes. Supplying an index outside of the range of 1 to 10, or supplying an index for which no node has been defined, will return 0 (FALSE). |
Bool |
Notes On View Types And Indices
To help visualise what cameras are being accessed using the SimVar CAMERA_VIEW_TYPE_AND_INDEX
, you can see them all in the "in-sim panel" UI for the camera, here:
In the image above, we're looking at the Cockpit camera panel (you can check or set this using the CAMERA_STATE
SimVar), and this panel has 3 different camera view types: Pilot, Instrument and Quickview. To check or set which of these view types is being used, you would use the CAMERA_VIEW_TYPE_AND_INDEX
using 0 for the camera type, and then you would use 1 for the option index within that category (note that options are counted from 0). For example:
CAMERA_VIEW_TYPE_AND_INDEX:0 = 2 CAMERA_VIEW_TYPE_AND_INDEX:1 = 3
This would be the following camera type and option:
IMPORTANT! If the camera type is 1 (for the Pilot view type), then the 4 default options will be indexed 1 (Close), 2 (Pilot), 4 (Landing), and 5 (Copilot), and the SimVar CAMERA_VIEW_TYPE_AND_INDEX_MAX
will return +1 for the number of options (ie: 5 not 4 by default). This is due to the internal requirements of the code.
Chase (External) Cameras
Simulation Variable | Description | Units | Settable |
---|---|---|---|
CHASE CAMERA HEADLOOK |
This is used to get/set the look state of the chase (external) camera. Note that this value will also affect the CAMERA_SUBSTATE value, when the CAMERA_STATE is set to 3 (External/Chase). |
Enum:
|
|
CHASE CAMERA MOMENTUM |
Sets/gets the momentum modifier of the chase (external) camera, which is controls how fast/slow the camera will stop moving when no longer being moved by the user. Default is 50%. | Percentage | |
CHASE CAMERA SPEED |
Sets/gets the translation speed modifier of the chase (external) camara, as a percentage. Default is 50%. | Percentage | |
CHASE CAMERA ZOOM |
Sets/gets the zoom/FOV modifier for the chase (external) camera. Note that when setting this value, it will affect the camera regardless of whether the GAMEPLAY_CAMERA_FOCUS is set to manual or automatic. Default is 50%. |
Percentage | |
CHASE CAMERA ZOOM SPEED |
Sets/gets the speed modifier for when the zoom/FOV chase (external) camera changes zoom/FOV levels. Default is 50%. | Percentage |
Cockpit Cameras
Simulation Variable | Description | Units | Settable |
---|---|---|---|
CAMERA ACTION COCKPIT VIEW RESET |
This can be used to reset the cockpit camera when the CAMERA_STATE is set to 2 (Cockpit). Essentially the same as the user pressing the default reset keys CTRL + Space . |
Bool | |
CAMERA ACTION COCKPIT VIEW SAVE:index |
This can be used to save a cockpit camera when the CAMERA_STATE is set to 2 (Cockpit). The index value given is the save "slot" that will be used, from 0 to 9. Essentially this is the same as the user pressing the default save keys CTRL + Alt + 0-9 . |
Bool | |
COCKPIT CAMERA HEADLOOK |
This is used to get/set the look state of the cockpit camera. Note that this value will also affect the CAMERA_SUBSTATE value, when the CAMERA_STATE is set to 2 (Cockpit). |
Enum:
|
|
COCKPIT CAMERA HEIGHT |
This can be used to get/set the cockpit camera height modifier expressed as a percentage. Default is 50%. | Percentage | |
COCKPIT CAMERA INSTRUMENT AUTOSELECT |
This can be used to get or set the autoselect option for the cockpit camera when viewing the instruments (ie: the CAMERA_SUBSTATE is 5). When enabled the camera will move automatically if the player mouse reaches the edge of the screen and there are instrument panels available on that side. |
Bool | |
COCKPIT CAMERA MOMENTUM |
Sets/gets the momentum modifier of the cockpit camera, which is controls how fast/slow the camera will stop moving when no longer being moved by the user. Default is 50%. | Percentage | |
COCKPIT CAMERA SIDE |
Not currently used in the simulation. | Enum | |
COCKPIT CAMERA SPEED |
Sets/gets the translation speed modifier of the cockpit camara, as a percentage. Default is 50%. | Percentage | |
COCKPIT CAMERA UPPER POSITION |
Sets/gets the current "upper position" cockpit camera toggle. When 1 (TRUE), the camera is is in the upper position, and when 0 (FALSE) it is in the default position. | Bool | |
COCKPIT CAMERA ZOOM |
Sets/gets the zoom/FOV modifier for the cockpit camera. Note that when setting this value, it will affect the camera regardless of whether the GAMEPLAY_CAMERA_FOCUS is set to manual or automatic. Default is 50%. |
Percentage | |
COCKPIT CAMERA ZOOM SPEED |
Sets/gets the speed modifier for when the zoom/FOV cockpit camera changes zoom/FOV levels. Default is 50%. | Percentage |
Drone Cameras
Simulation Variable | Description | Units | Settable |
---|---|---|---|
DRONE CAMERA FOCUS |
Sets/gets the focus modifier for the drone camera. Default is 50%, and a lower value will set the drone focus to things in the foreground and a higher level will set the drone focus to things in the background. Note that this is only taken into account when the DRONE_CAMERA_FOCUS_MODE is set to 3 (manual). |
Percentage | |
DRONE CAMERA FOCUS MODE |
Sets/gets the current drone focus mode. When set to 3 (manual), the focus position will be based on the DRONE_CAMERA_FOCUS value. |
Enum:
|
|
DRONE CAMERA FOLLOW |
Sets/gets the whether the drone camera is in follow mode or not. | Bool | |
DRONE CAMERA FOV |
Sets/gets the zoom/FOV modifier for the drone camera. Default is 50%. | Percentage | |
DRONE CAMERA LOCKED |
Sets/gets the whether the drone camera is locked or not. | Bool | |
DRONE CAMERA SPEED ROTATION |
Sets/gets the rotation speed modifier of the drone camara, as a percentage. Default is 50%. | Percentage | |
DRONE CAMERA SPEED TRAVELLING |
Sets/gets the translation speed modifier of the drone camara, as a percentage. Default is 50%. | Percentage |
Smart Cameras