Hi,
is there any way to trigger animation using SimVar such as:
(A:LIGHT NAV ON, Bool).
The idea is to start the hangar Open animation door when the NAV LIGHT is set to ON and trigger the Close Animation when the NAV LIGHT is set to OFF.
I’ve never tried to use SimVar, so I may have done stupid stuff.
I’ve written some code, but it hasn’t been working so far, can anybody help me?
<?xml version="1.0" encoding="utf-8"?> <Animation name="LKPR_Door_Default" guid="dc71896e-6cf7-4740-9f22-7e5a1b008a9f" length="2" name="LKPR_Door_Default" type="Sim" typeParam="AutoPlay" typeParam2="LKPR_Door_Default" /> <Animation name="LKPR_Door_Open" guid="337194ad-0345-4907-9c59-ec2be2511620" length="900" name="LKPR_Door_Open" type="Sim" typeParam="AutoPlay" typeParam2="LKPR_Door_Open" /> <Animation name="LKPR_Door_Closed" guid="b9b5e1d3-c686-4791-8b5d-45595938ffc3" length="900" name="LKPR_Door_Closed" type="Sim" typeParam="AutoPlay" typeParam2="LKPR_Door_Closed" /> <AnimGraph> <DefaultState name="LKPR_Door_Default"/> <BlendTreeState name="LKPR_Door_Default"> <Animations> <Animation guid="dc71896e-6cf7-4740-9f22-7e5a1b008a9f" loop ="True" speed="1" /> <Animation guid="337194ad-0345-4907-9c59-ec2be2511620" loop ="True" speed="1" /> <Animation guid="b9b5e1d3-c686-4791-8b5d-45595938ffc3" loop ="True" speed="1" /> </Animations> </BlendTreeState> </AnimGraph> <PartInfo> <Name>LKPR_Door_Open</Name> <AnimLength>900</AnimLength> <Animation> <Parameter> <Code>(A:LIGHT NAV ON, Bool) 0</Code> </Parameter> </Animation> </PartInfo>
<?xml version="1.0" encoding="utf-8"?> <Animation name="door1" guid="337194ad-0345-4907-9c59-ec2be2511620" type="Standard" /> <Animation name="door2" guid="b9b5e1d3-c686-4791-8b5d-45595938ffc3" type="Standard" /> <AnimGraph> <DefaultState name="Anim"/> <BlendTreeState name="Anim"> <Animations> <Animation guid="337194ad-0345-4907-9c59-ec2be2511620" loop ="True" speed="1" threshold="0"/> <Animation guid="b9b5e1d3-c686-4791-8b5d-45595938ffc3" loop ="True" speed="1" threshold="0"/> </Animations> <Value>(A:LIGHT NAV ON, Bool)</Value> </AnimGraph>
This kind of approach worked, but it only trigger the animation ONCE, if I use the loop=True it never stops, otherwise it only gets called once.