Forum Discussion

NicoleKluge-fdc's avatar
NicoleKluge-fdc
Community Member
3 years ago

Change Variable based on state

Hello Heroes,

in my project I want to get variables changed based on states. There is the possibility to get a variable changed, "if minimum 1 object has (not) a state".

I attached the picture of the trigger, I'm talking about and a Test-SL-File.

In my opinion it should work to get the different variable values when all objects are in normal state or in other states and i want to have a 3rd value, when nothing of all fits.

Hope u guys can help me.

  • Hi,  Nicky.

    Thank you for sharing your .story file!

    I'm attaching the edited version here with my suggestion, which is to create another state called "grey" for your ovals instead of using the Normal state.

    Windows 10 (1) 2021-12-15 at 10.01.18 AM

    Once the triggers are changed to reflect the new state, the project works as expected.

    Let me know if this helps!

  • Oh Maria, thanks for your help. This is strange that u cannot use the normal state for such things.

    I also noticed that it is very important to check the order of the triggers, cause sometimes it happens that there are two conditions correct and one of them is more specific, so u put it after the other trigger. U can manage it by copy and paste, to get it below other triggers.

    then again thank you Maria, that worked for me and my problem :)

  • Hi Maria,

    thanks for showing it, but those arrows are not always there. In my example they are disabled. They only appear when you have triggers on an object. In my example it could happen that the variable gets overwritten by another trigger.