Variable for player (not plane) position when exiting plane in MSFS 2024?

In looking through the SimConnect documentation I’m not able to find a way to get the player’s position (lat/lon) when they have exited the cockpit and are in the new “walk around” mode which in addition to allowing them to preflight technically lets them explore the world on foot.

I’ve tried grabbing CAMERA STATE and CAMERA VIEW TYPE AND INDEX variables but they both just return Cockpit even when the player is outside of the plane. And besides, the enums for those variables don’t really have anything that would exactly match up with the scenario.

Does anyone know of a way to accomplish getting the player’s position when outside of the plane similar to how we can grab the plane’s position? Either directly through a variable I haven’t found that makes this easy, or by inferring that we’re in an “outside the plane” state via a specific combination of different variables?

Ok I got it working! As it turns out you can continue to just pull PLANE LONGITUDE and PLANE LATITUDE. The trick is that when you call RequestDataOnSimObjectType you need to pass in SIMCONNECT_SIMOBJECT_TYPE.USER_AVATAR instead of SIMCONNECT_SIMOBJECT_TYPE.USER.

When doing this in MSFS 2024 its quite straight forward as when the player is inside the plane, you effectively continue to get the plane’s position. But when they exit the plane, you get the player’s position regardless of how far away they are from the plane.

However, I had to add some code to try and detect whether MSFS 2020 or 2024 is running since you cannot use SIMCONNECT_SIMOBJECT_TYPE.USER_AVATAR with MSFS 2020. It doesn’t cause a crash, but it doesn’t return any data. On a similar note, other variables I was using or plan to use like PLANE ALT ABOVE GROUND and GEAR IS ON GROUND still require using SIMCONNECT_SIMOBJECT_TYPE.USER even in MSFS 2024.

Anyways hope this helps anyone in the future that had a similar question.

The only thing I don’t know how to do is actually know whether the player is inside or outside of the plane. I have my scenario working regardless but there’s some extra things I’d be able to do if I could know that information.

Maybe you could use the environment variable “IS AVATAR”:

Best regards,

Eric / Asobo

Perfect! Thank you! I had found another proxy via USER INPUT ENABLED but worried that could break over time or have edge cases I was unaware of. I love that there’s a variable dedicated to this that can be relied upon.

It’s working great.