Conditional variable not working #83
Replies: 3 comments 5 replies
-
If you look at your log, the switch is active at the start, and isn't inactive until your last line. This the argument is true. It is active, and the value is 0, so it makes it a 1. It is STILL active and is 1, so it makes it a 0. I would use an event, not a switch state. An event happens 1 time, whereas a switch stays in a state for a period of time. Do you have a shot defined? If not, I would define one. Then trigger your logic off of target_red_1_hit or target_red_1_lit_hit or one of those varieties. You can find what is right for your desired outcome. But that should eliminate this issue for you. |
Beta Was this translation helpful? Give feedback.
-
Hi, I have made a purely virtual example, maybe someone can run it and gets an idea what is wrong.
Thanks. |
Beta Was this translation helpful? Give feedback.
-
Closing this discussion, see the linked issue for more details. In short, the variable player executes all the entries sequentially and the first one changes the player variable to the value that then makes the second one true. So this is not an issue with the variable player, but the configuration of having conditional variable players change the value of the condition while they are simultaneously being evaluated. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have a variable player like this
when my switch s_target_red_1 is being activated I want to toggle a variable called status_target_light_red_0, that variable should be either 0 or 1.
The problem now is that when the switch is activated that always both conditional entries are being executed, so the last in the list wins. In the above example the value is always 0, if I swap the order the value is always 1.
The log shows
As you can see both entries in the variable player are execute for each activation. What is wrong here?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions