Hello,
Could someone help me to know how to trigger my simobject animation when I approach it in freecam (drone view). depending on the distance from the object and the camera.
I tried these codes
<Behaviors>
<Include ModelBehaviorFile="Asobo\Misc\SimObjects.xml" />
<Component ID="MYSIMOBJECT" Node="MYSIMOBJECT">
<Visibility>
<Parameter>
<Code>1 (>Z:VisibleRadiusBox)</Code>
</Parameter>
</Visibility>
</Component>
<Animation guid="MYGUID" length="100" name="MYSIMOBJECT" type="Sim" typeParam="AutoPlay" typeParam2="MYSIMOBJECT"/>
<AnimGraph>
<DefaultState name="MYSIMOBJECT"/>
<BlendTreeState name="MYSIMOBJECT">
<Animations>
<Animation guid="MYGUID" loop="True" speed="1" threshold="0"/>
</Animations>
</BlendTreeState>
</AnimGraph>
<PartInfo>
<Name>MYSIMOBJECT</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(Z:VisibleRadiusBox, Number) 0 == if{ 100 } els{ 1 }
</Code>
<Lag>30</Lag>
</Parameter>
</Animation>
</PartInfo>
</Behaviors>
According that a Camera API isn’t available despite being requested for a long time…
Can’t you just rely on the LOD system?
When you are close (Lod0) will have the mesh you want to display (animated)
Far away (lod1) a still mesh
Otherwise you can use a worldscript do place the Simobject and trigger the animState with a proximity trigger
(But that need your user to trigger the area, it won’t react to the camera)
…
The code you posted makes little sense, where are you using it?
Thank you, I’ve just been digging into this subject and I’ve found someone who has managed to do with what you’re telling me.
I’ve tried to reproduce his code by matching my simobject as closely as possible but it doesn’t work yet.
Do you think I made a mistake? I had the xml checked and it’s fine.
<LODS>
<LOD minSize="70" ModelFile="DOOR_01_LOD00.gltf" MinSize="70"/>
<LOD minSize="18" ModelFile="DOOR_01_LOD01.gltf" MinSize="18"/>
</LODS>
<Animation guid="832c27fc-3588-4c82-8ecc-9a0db634136a" length="100" name="DOOR_01" type="Sim" typeParam="AutoPlay" typeParam2="DOOR_01"/>
<AnimGraph>
<DefaultState name="DOOR_01_LOD00"/>
<BlendTreeState name="DOOR_01">
<Animations>
<Animation guid="1a08cd3f-f384-41b9-8573-099cd42a25e5" loop="True" speed="1" threshold="0"/>
</Animations>
</BlendTreeState>
</AnimGraph>
<PartInfo>
<Name>DOOR_01</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(Z:VisibleRadiusBox, Number) 1 == if{ 100 } els{ 0 }
</Code>
<Lag>30</Lag>
</Parameter>
</Animation>
</PartInfo>
<ModelBehaviors>
<Include Path="Asobo\Misc\SimObjects.xml"/>
<Component ID="LOD00" Node="DOOR_01_LOD00">
<Visibility>
<Parameter>
<Code>1 (>Z:VisibleRadiusBox)</Code>
</Parameter>
</Visibility>
</Component>
<Component ID="LOD01" Node="DOOR_01_LOD01">
<Visibility>
<Parameter>
<Code>0 (>Z:VisibleRadiusBox)</Code>
</Parameter>
</Visibility>
</Component>
</ModelBehaviors>
</ModelInfo>
For the code i posted previously, i’m sorry, i forgot to preformatted it
I’m familiar with that code 
But the main issue is that the code is trying to set a simvar based upon the " visibility " of a node
However, the purpose of visibility tag is to set the visibility of that node
So it was a bug that the code worked in 2020,
But is correct that it doesn’t work in 2024
And actually it should be Behaviors rather than ModelBehaviors
for the “ModelBehaviors"‘ I’ve already tested simply with "Behaviors ” but it doesn’t change anything.
This simobject is for MSFS2020
So in the end, what’s the best thing to do?
do you have an example for me please ?