I am trying to change the camera state for my aircraft using
SimVars/SimConnect. I am using the following code below. It appears to be
right, but does not institute any change in the active simulator. Does anyone
know how to fix this? hr =
SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_CAMERA, “CAMERA STATE”,
NULL); camState.state = 19; hr = SimConnect_SetDataOnSimObject(hSimConnect,
DEFINITION_CAMERA, SIMCONNECT_OBJECT_ID_USER, 0, 0, sizeof(camState),
&camState;);
To change cameras in MSFS you have to change more than one simvar, pay
attention to the camera state index, etc.
https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Camera_Variables.htm
What we have available is supper limited, hopefully a better camera API system
that would allow US to change the position of a camera to any location, FOV,
zoom, etc. will be developed in the future. Best, Raul
Thank you for your help. After adding in view type variable it is now working.