# Camera Variables The tables below indicate the requirements for the [Simulation Variables](../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](../simulation-variable-units/) You can find a complete index of all available SimVars here: [SimVar Index](../simulation-variables/#simvar-index) ### Cameras {{< table-wrapper "colclass-2=font-size:0.75rem" "200px" "100px" "" "250px" "100px" >}} | Simulation Variable | Index | Description | Units | Settable | |---|---|---|---|:---:| | {{< anchor id="CAMERA-GAMEPLAY-PITCH-YAW" />}}`CAMERA GAMEPLAY PITCH YAW` | Pitch / Yaw | Returns either the pitch (`index 0`) or the yaw (`index 1`) of the current gameplay camera. | Radians | {{< check/bad >}} | | {{< anchor id="CAMERA-REQUEST-ACTION" />}}`CAMERA REQUEST ACTION` | N/A | 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:{{< params/smallfont >}}1 = Reset Active Camera (in VR this will recenter the headset view)2 = Move Active Camera{{< /params/smallfont >}} | {{< check/good >}} | | {{< anchor id="CAMERA-STATE" />}}`CAMERA STATE` | N/A | This can be used to get or set the camera "state", which will be one of the listed enum values.Note that not all poossible values will do anything as some belong to legacy systems no longer used in MSFS 2024 and others 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:{{< params/smallfont >}}1 = Forced Custom Target Position2 = Cockpit3 = Chase Plane Drone4 = Fixed On Plane5 = Environment 6DOF6 = Gameplay7 = Showcase8 = Drone Plane9 = Waiting10 = World Map11 = Hangar RTC12 = Hangar Custom13 = Menu RTC14 = In Game RTC15 = Replay16 = Drone Developer17 = Drone Top Down18 = Follow Actor19 = Hangar20 = Old Drone Plane21 = Chase F18 Plane22 = Ground23 = Follow Air Traffic Plane24 = First View25 = Drone Photo Mode26 = Third View27 = Transition28 = Catch Object29 = Idle30 = World Map Idle31 = Explore Flightpath Drone32 = Focus Location33 = Worldmap Transition{{< /params/smallfont >}} | {{< check/good >}} | | {{< anchor id="CAMERA-SUBSTATE" />}}`CAMERA SUBSTATE` | N/A | 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`](#COCKPIT-CAMERA-HEADLOOK), [`CHASE CAMERA HEADLOOK`](#CHASE-CAMERA-HEADLOOK). | Enum:{{< params/smallfont >}}1 = Locked (*Fixed look or chase lock - The camera is locked in position*)2 = Unlocked (*Head look or Chase normal - The camera is "attached" to the mouse*)3 = Quickview (*the camera is currently using a Quickview*)4 = Smart (*The camera has Smart camera active*)5 = Instrument (*The camera is focused on an instruments panel*){{< /params/smallfont >}} | {{< check/good >}} | | {{< anchor id="CAMERA-VIEW-TYPE-AND-INDEX" />}}`CAMERA VIEW TYPE AND INDEX` | Camera 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 [`CAMERA VIEW TYPE AND INDEX MAX`](#CAMERA-VIEW-TYPE-AND-INDEX-MAX) SimVar). Supplying an index of 0 to the SimVar will get/set the type (from the selection of enum values listed), and using an index of 1 will get/set the option index, which is an integer value.Please see the [Notes On View Types And Indices](#notes-on-view-types-and-indices) section below for more information. | Enum (`index = 0`):{{< params/smallfont >}}0 = Unknown / default (*External / Chase and Showcase /* *Drone / Fixed / Environment states*)1 = Pilot View (*Cockpit State*)2 = Instruments (*Cockpit State*)3 = Quickview (*Cockpit State*)4 = Quickview External (*External State*)5 = View (*Showcase / Drone / Fixed /* *Environment states*){{< /params/smallfont >}}orNumber (`index = 1`) | {{< check/good >}} | | {{< anchor id="CAMERA-VIEW-TYPE-AND-INDEX-MAX" />}}`CAMERA VIEW TYPE AND INDEX MAX` | Camera Type 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 [`CAMERA VIEW TYPE AND INDEX`](#CAMERA-VIEW-TYPE-AND-INDEX)), and the SimVar will return the number of options available for that camera type (counting from 1, so - for example - if the camera view type is "Quickview" and has 8 quickview settings, then `CAMERA VIEW TYPE AND INDEX MAX:4` will return 8). Note that this value can be set after a flight has started, but it will have no effect since the number of camera options is initilaised once only and not updated (and the simulation may overwrite the value again even after setting it).Please see the [Notes On View Types And Indices](#notes-on-view-types-and-indices) section below for more information. | Number | {{< check/good >}} | | {{< anchor id="DIRECTORS-CUT-CAMERA-PITCH" />}}`DIRECTORS CUT CAMERA PITCH` | N/A | Gets/sets the pitch of the Director's Cut camera gimbal. | Percent | {{< check/good >}} | | {{< anchor id="DIRECTORS-CUT-CAMERA-YAW" />}}`DIRECTORS CUT CAMERA YAW` | N/A | Gets/sets the yaw of the Director's Cut camera gimbal. | Percent | {{< check/good >}} | | {{< anchor id="GAMEPLAY-CAMERA-FOCUS" />}}`GAMEPLAY CAMERA FOCUS` | N/A | 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`](#COCKPIT-CAMERA-ZOOM) or [`CHASE CAMERA ZOOM`](#CHASE-CAMERA-ZOOM). | Enum:{{< params/smallfont >}}0 = Auto1 = Manual{{< /params/smallfont >}} | {{< check/good >}} | | {{< anchor id="IS-CAMERA-LOCKED" />}}`IS CAMERA LOCKED` | N/A | This will return whether the camera is locked (1, `TRUE`) or not (0, `FALSE`). | Bool | {{< check/bad >}} | | {{< anchor id="IS-CAMERA-RAY-INTERSECT-WITH-NODE" />}}`IS CAMERA RAY INTERSECT WITH NODE` | Node | This SimVar is used to check for a collision along a ray from the center of the user {{< glossterm >}}fov{{< /glossterm >}} and a model node. The available nodes that can be checked using this SimVar must be previously defined in the [`[CAMERA_RAY_NODE_COLLISION]`](../../../content-configuration/cfg-files/cameras.cfg/#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 | {{< check/bad >}} | {{< /table-wrapper >}} ##### Notes On View Types And Indices To help visualise what cameras are being accessed using the SimVar [`CAMERA VIEW TYPE AND INDEX`](#CAMERA-VIEW-TYPE-AND-INDEX), you can see them all in the "in-sim panel" UI for the camera, here: {{< image-center src="images/6_Programming/SimVar/Cameras_1.png" alt="Camera In-Sim Panel UI" >}} In the image above, we're looking at the Cockpit camera panel (you can check or set this using the [`CAMERA STATE`](#CAMERA-STATE) SimVar), and this panel has 4 different camera view *types*: Pilot, Instrument, Quickview, and SmartCam Targets. To check or set which of these view types is being used, you would use the [`CAMERA VIEW TYPE AND INDEX`](#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: ``` codeblock CAMERA VIEW TYPE AND INDEX:1 = 3 ``` This would be the following camera type and option: {{< image-center src="images/6_Programming/SimVar/Cameras_2.png" alt="In-Sim Camera Panel Instruments Type And Options" >}} {{< callout context="caution" title="IMPORTANT!" icon="outline/alert-triangle" >}} 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`](#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. {{< /callout >}} ### Chase (External) Cameras {{< table-wrapper "colclass-2=font-size:0.75rem" "200px" "100px" "" "150px" "100px" >}} | Simulation Variable | Index | Description | Units | Settable | |---|---|---|---|:---:| | {{< anchor id="CHASE-CAMERA-HEADLOOK" />}}`CHASE CAMERA HEADLOOK` | N/A | This is used to get/set the look state of the chase (external) camera. Note that this value will also affect the [`CAMERA SUBSTATE`](#CAMERA-SUBSTATE) value, when the [`CAMERA STATE`](#CAMERA-STATE) is set to 3 (External/Chase). | Enum:{{< params/smallfont >}}1 = Freelook2 = Headlook{{< /params/smallfont >}} | {{< check/good >}} | | {{< anchor id="CHASE-CAMERA-MOMENTUM" />}}`CHASE CAMERA MOMENTUM` | N/A | 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 | {{< check/good >}} | | {{< anchor id="CHASE-CAMERA-SPEED" />}}`CHASE CAMERA SPEED` | N/A | Sets/gets the translation speed modifier of the chase (external) camera, as a percentage. Default is 50%. | Percentage | {{< check/good >}} | | {{< anchor id="CHASE-CAMERA-ZOOM" />}}`CHASE CAMERA ZOOM` | N/A | Sets/gets the zoom/{{< glossterm >}}fov{{< /glossterm >}} modifier for the chase (external) camera. Note that when setting this value, it will affect the camera regardless of whether the [`GAMEPLAY CAMERA FOCUS`](#GAMEPLAY-CAMERA-FOCUS) is set to manual or automatic. Default is 50%. | Percentage | {{< check/good >}} | | {{< anchor id="CHASE-CAMERA-ZOOM-SPEED" />}}`CHASE CAMERA ZOOM SPEED` | N/A | Sets/gets the speed modifier for when the zoom/{{< glossterm >}}fov{{< /glossterm >}} chase (external) camera changes zoom/{{< glossterm >}}fov{{< /glossterm >}} levels. Default is 50%. | Percentage | {{< check/good >}} | {{< /table-wrapper >}} ### Cockpit Cameras {{< table-wrapper "colclass-2=font-size:0.75rem" "200px" "100px" "" "150px" "100px" >}} | Simulation Variable | Index | Description | Units | Settable | |---|---|---|---|:---:| | {{< anchor id="CAMERA-ACTION-COCKPIT-VIEW-RESET" />}}`CAMERA ACTION COCKPIT VIEW RESET` | N/A | This can be used to reset the cockpit camera when the [`CAMERA STATE`](#CAMERA-STATE) is set to 2 (Cockpit). Essentially the same as the user pressing the default reset keys {{< input "Ctrl" />}} + {{< input "Space" />}}. | Bool | {{< check/good >}} | | {{< anchor id="CAMERA-ACTION-COCKPIT-VIEW-SAVE" />}}`CAMERA ACTION COCKPIT VIEW SAVE` | N/A | This can be used to save a cockpit camera when the [`CAMERA STATE`](#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 {{< input "Ctrl" />}} + {{< input "Alt" />}} + {{< input "0" />}}-{{< input "9" />}}. | Bool | {{< check/good >}} | | {{< anchor id="COCKPIT-CAMERA-HEADLOOK" />}}`COCKPIT CAMERA HEADLOOK` | N/A | This is used to get/set the look state of the cockpit camera. Note that this value will also affect the [`CAMERA SUBSTATE`](#CAMERA-SUBSTATE) value, when the [`CAMERA STATE`](#CAMERA-STATE) is set to 2 (Cockpit). | Enum:{{< params/smallfont >}}1 = Freelook2 = Headlook{{< /params/smallfont >}} | {{< check/good >}} | | {{< anchor id="COCKPIT-CAMERA-HEIGHT" />}}`COCKPIT CAMERA HEIGHT` | N/A | This can be used to get/set the cockpit camera height modifier expressed as a percentage. Default is 50%. | Percentage | {{< check/good >}} | | {{< anchor id="COCKPIT-CAMERA-INSTRUMENT-AUTOSELECT" />}}`COCKPIT CAMERA INSTRUMENT AUTOSELECT` | N/A | This can be used to get or set the autoselect option for the cockpit camera when viewing the instruments (ie: the [`CAMERA SUBSTATE`](#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 | {{< check/good >}} | | {{< anchor id="COCKPIT-CAMERA-MOMENTUM" />}}`COCKPIT CAMERA MOMENTUM` | N/A | 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 | {{< check/good >}} | | {{< anchor id="COCKPIT-CAMERA-SIDE" />}}`COCKPIT CAMERA SIDE` | N/A | *Not currently used in the simulation.* | Enum | {{< check/bad >}} | | {{< anchor id="COCKPIT-CAMERA-SPEED" />}}`COCKPIT CAMERA SPEED` | N/A | Sets/gets the translation speed modifier of the cockpit camara, as a percentage. Default is 50%. | Percentage | {{< check/good >}} | | {{< anchor id="COCKPIT-CAMERA-UPPER-POSITION" />}}`COCKPIT CAMERA UPPER POSITION` | N/A | 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 | {{< check/good >}} | | {{< anchor id="COCKPIT-CAMERA-ZOOM" />}}`COCKPIT CAMERA ZOOM` | N/A | Sets/gets the zoom/{{< glossterm >}}fov{{< /glossterm >}} modifier for the cockpit camera. Note that when setting this value, it will affect the camera regardless of whether the [`GAMEPLAY CAMERA FOCUS`](#GAMEPLAY-CAMERA-FOCUS) is set to manual or automatic. Default is 50%. | Percentage | {{< check/good >}} | | {{< anchor id="COCKPIT-CAMERA-ZOOM-SPEED" />}}`COCKPIT CAMERA ZOOM SPEED` | N/A | Sets/gets the speed modifier for when the zoom/{{< glossterm >}}fov{{< /glossterm >}} cockpit camera changes zoom/{{< glossterm >}}fov{{< /glossterm >}} levels. Default is 50%. | Percentage | {{< check/good >}} | {{< /table-wrapper >}} ### Drone Cameras {{< table-wrapper "colclass-2=font-size:0.75rem" "200px" "100px" "" "150px" "100px" >}} | Simulation Variable | Index | Description | Units | Settable | |---|---|---|---|:---:| | {{< anchor id="DRONE-CAMERA-FOCUS" />}}`DRONE CAMERA FOCUS` | N/A | 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`](#DRONE-CAMERA-FOCUS-MODE) is set to 3 (manual). | Percentage | {{< check/good >}} | | {{< anchor id="DRONE-CAMERA-FOCUS-MODE" />}}`DRONE CAMERA FOCUS MODE` | N/A | Sets/gets the current drone focus mode. When set to 3 (manual), the focus position will be based on the [`DRONE CAMERA FOCUS`](#DRONE CAMERA FOCUS) value. | Enum:{{< params/smallfont >}}1 = Deactivated2 = Auto3 = Manual{{< /params/smallfont >}} | {{< check/good >}} | | {{< anchor id="DRONE-CAMERA-FOLLOW" />}}`DRONE CAMERA FOLLOW` | N/A | Sets/gets the whether the drone camera is in follow mode or not. | Bool | {{< check/good >}} | | {{< anchor id="DRONE-CAMERA-FOV" />}}`DRONE CAMERA FOV` | N/A | Sets/gets the zoom/{{< glossterm >}}fov{{< /glossterm >}} modifier for the drone camera. Default is 50%. | Percentage | {{< check/good >}} | | {{< anchor id="DRONE-CAMERA-LOCKED" />}}`DRONE CAMERA LOCKED` | N/A | Sets/gets the whether the drone camera is locked or not. | Bool | {{< check/good >}} | | {{< anchor id="DRONE-CAMERA-SPEED-ROTATION" />}}`DRONE CAMERA SPEED ROTATION` | N/A | Sets/gets the rotation speed modifier of the drone camara, as a percentage. Default is 50%. | Percentage | {{< check/good >}} | | {{< anchor id="DRONE-CAMERA-SPEED-TRAVELLING" />}}`DRONE CAMERA SPEED TRAVELLING` | N/A | Sets/gets the translation speed modifier of the drone camara, as a percentage. Default is 50%. | Percentage | {{< check/good >}} | {{< /table-wrapper >}} ### Smart Cameras {{< table-wrapper "colclass-2=font-size:0.75rem" "200px" "100px" "" "250px" "100px" >}} | Simulation Variable | Index | Description | Units | Settable | |---|---|---|---|:---:| | {{< anchor id="SMART-CAMERA-ACTIVE" />}}`SMART CAMERA ACTIVE` | N/A | Sets/gets the whether the smart camera is active or not. | Bool | {{< check/good >}} | | {{< anchor id="SMART-CAMERA-INFO" />}}`SMART CAMERA INFO` | Camera Index | Gets information on the smartcam system. The index sets what kind of information will be returned (or set):{{< params/smallfont >}}0 = Gets the number of smartcam targets in the smart camera list1 = Gets or sets the index of the currently selected smartcam target, counting from 0 (so index 0 is the first target in the list).{{< /params/smallfont >}} | Number | {{< check/good >}} | | {{< anchor id="SMART-CAMERA-LIST" />}}`SMART CAMERA LIST` | Camera Index | Retrieves the type of target for the indexed position in the smartcam list, counting from 0 (so index 0 is the first target in the list). | Enum:{{< params/smallfont >}}0 = unknown {{< glossterm >}}poi{{< /glossterm >}}1 = Follow {{< glossterm >}}poi{{< /glossterm >}}2 = User {{< glossterm >}}poi{{< /glossterm >}}3 = General {{< glossterm >}}poi{{< /glossterm >}}4 = End OF Runway5 = Landing Runway6 = Flightpath7 = Object Interaction8 = Multiplayer {{< glossterm >}}ooi{{< /glossterm >}}9 = Active Runway10 = Waypoint11 = Airport {{< glossterm >}}ooi{{< /glossterm >}}12 = Flight Assistant Destination{{< /params/smallfont >}} | {{< check/bad >}} | | {{< anchor id="SMART-CAMERA-LIST-DESCRIPTION" />}}`SMART CAMERA LIST DESCRIPTION` | Camera Index | This returns a localized string that represents the smartcam target specified by the given index. Indices count from 0 so index 0 is the first target in the list. | String | {{< check/bad >}} | {{< /table-wrapper >}}