Forum Discussion
States not changing when variable changes
Hello Community;
I have a project where on Scene 1 I have 7 button menu. I have an image with the words "Completed" that is initially in a hidden state over the button.
When the learner completes Module 1 (scene 2), a variable is set to change when the timeline starts on the last slide of Scene 2;
- "Set Status_Module_1 to value True When the timeline starts on this slide"
Back on Scene 1, on the menu slide, the trigger is set as follows:
- Set state of Comp-Mod1 - "Completed" to Normal when status_module_1 changes
- I've also tried with as: Set state of Comp-Mod1 - "Completed" to Normal when status_module_1 changes if Status_Module_1 = value True
When the variable changes in Scene 2, the state of Comp-Mod1 does not change to Normal.
What am I missing?
- WaltHamiltonSuper Hero
When a variable changes can be heard only on the slide that changes it. So you need something else to initiate your trigger on the menu slide. I usually use "when timeline starts on this slide"
Walt's right. If you think about it, your trigger is to do X when the variable changes, however, the variable isn't changing (because it's already been changed).
So to Walt's point, you are revisiting that slide and at that point you want to review the variables and if the variable = X do something (change the button)
So it's change the state of the button when the timeline of the slide starts on the condition that variable = X.- TomStrancaricCommunity Member
Thank you kindly! So logical! :)
Success with changing the trigger to:
Set state of Comp-Mod1 - "Completed" to Normal; when the timeline starts on this slide; if status_module_1 = value True
Glad it worked for you.
That's probably one of the most common issues when using variables. Personally, I always find that my logic isn't the right logic, so I often have to pencil out what's happening so I can think through everything. Probably why I'm not a programmer :)
- SouveekPalCommunity Member
I had the same problem. Thanks a lot.