Forum Discussion

StevenWatson's avatar
StevenWatson
Community Member
3 years ago

Can't get a state to change when a variable becomes true

I am creating a 'Who wants to be a millionaire' game which has the lifelines of 50:50, phone a friend and ask the audience. 

When a user clicks on any one of these, in future slides I want the state to be change to 'disabled' as it has already been used. 

What I have done is create a variable that will change from false to true when a button is clicked on and then there is a trigger to change the state of the button to 'disabled' if the variable is now set to 'true'.

But, it is not working. When I get to the next slide, the lifeline button is still showing as clickable, although clicking on it doesn't show the layer (so that bit works). I have created a text box with a reference which shows the variable is changing to true but the state change isn't taking effect.

I have attached a screenshot showing the triggers for the 50:50 button if that helps.

Any ideas on what I could be getting wrong here?

  • Did you add 'when the timeline starts on this slide' on the trigger which is responsible for disenabling the button? 

    Set state of 50:50- ''50:50'' to Disabled 
    When the timeline starts on
    this slide
    if 5050selected changes
    if 5050selected = value true 

     

    • StevenWatson's avatar
      StevenWatson
      Community Member

      You are a genius! I knew it was something simple that I was getting wrong. 

      This works perfectly.