Visibility Condition tags for interior and exterior

Hello everybody! I’m trying to make a specific condition for an object to become visible only in the inner view camera and that disappears when using any outer view. It is possible? Perhaps some example of this kind of code would be very useful. I thank you in advance!

Hello @RoProdMoraes,
I have moved your topic into the SDK category for assistance. :+1:

1 Like

@Hester40MT Thank you!

1 Like

Reading the Camera State variable is perhaps the most effective way of determining which view you are currently in.

https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Camera_Variables.htm?rhhlterm=camera%20state&rhsearch=camera%20state

Thanks for the answer @antsair031 !

I looked at the documentation at the given link and it was very helpful, but I still couldn’t solve the problem. By adding the indicated line of code, my goal is to make the specific object visible only on the outside, but this way it doesn’t work, with the object remaining visible on the inside as well. Any idea?

<Component ID="Object" Node="Object">
  <UseTemplate Name="ASOBO_GT_Visibility">
    <VISIBILITY_CODE>(A:CAMERA STATE, Enum) 3 != and</VISIBILITY_CODE>
  </UseTemplate>
</Component>

Couple of things…

  1. The enum value of camera state for the cockpit cameras is 2, but in your code you’ve said ‘not 3’ so it will return true and be visible if any camera other than external/chase is active. Not quite what you want I think.

  2. You have a superfluous ‘and’ at the end, so the code is expecting two expressions that both must be valid to return true, but you’re only giving it one expression.

Try this…

<VISIBILITY_CODE>
(A:CAMERA STATE, Enum) 2 ==
</VISIBILITY_CODE>

That expression should only return true if a cockpit camera is active.

Cheers.