Switching boolean attribute on/off not working - why?

DigiChainDigiChain Member, PRO Posts: 1,288
edited November -1 in Working with GS (Mac)
I keep coming across small problems like this - and its obviously down to how GS works, but again I'm stuck...

I've created a attribute called FLIP

I have a button in my scene and it has these 2 rules:
Rule1:
When actor receives event - touch is pressed
AND Attribute Flipped = TRUE
> Change attribute - Flipped to FALSE

Rule 2:
When actor receives event - touch is pressed
AND Attribute Flipped = FALSE
> Change attribute - Flipped to TRUE

It doesn't work. It'll work if I only have one of the rules, but then can't be changed back. They obviously counteract each other somehow - but I don't see how.

How can I do this?

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
  • DigiChainDigiChain Member, PRO Posts: 1,288
    I've tried the suggestion but can't get it working - and I have to be honest I don't actually understand what its trying to do! What does the '%2' part do?

    I don't know if it makes a differences, but the image i'm pressing isn't the image I want to flip. The pressed image is just acting as a trigger.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Then what you are trying to do would have never worked with your original setup. Your button needs to be the first half controlling a game attribute instead of a self attribute and the actor you want to flip needs to have the second part.

    %2 is how you tell it to just cycle between 0 and 1 if you did %3 it would switch between 0, 1, & 2.
Sign In or Register to comment.