Press button to unlock first, but the button function still occurs

Hi All,

Firstly I had a button, which when pressed moved scenes (a simple 'on touch' rule).

Now I want to be able to 'unlock' the button first by pressing it, and then on next touch it then runs the 'next scene' rule mentioned above.

I have implemented a local variable on the actor, called 'unlocked'. Then the 'next scene' rule only works when pressed and it is marked as 'unlocked'. Now to mark as 'unlocked', I have a rule that says 'when pressed change LOCAL variable 'unlocked' to true'.

This seems like it should work, however when pressed it is instantly marking it as unlocked and straight away running the 'next scene' rule.

So it is doing everything in 1.

The reason I am doing this, is I am unlocking it if enough 'coins' have been selected (part of my IAP).

Any and all help welcome.

Thanks,

Best Answer

Answers

  • kanuvaskanuvas Member Posts: 21
    Top banana!
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Yes remember that when computers execute code it virtually happens a light speed as it's flowing electrons. So when you touch both can happen before you release your finger. By using release you tell it to execute after the touch is on then off and this combined with your lockout ensures it needs to be touched after the attribute changes not as a series of events based on the same type of execution.
Sign In or Register to comment.