Toggle switch, works but only for a few seconds?

rcheethamrcheetham UKMember Posts: 14
edited September 2014 in Working with GS (Mac)

Hi all,

I have an integer attribute named: toggle

I have button with the following rules:

When actor receives event - touch - pressed

- Change attribute: game.toggle - ( game.toggle +1)%2

I then have an actor displaying the value of toggle (either 0 or 1).

The toggle function works correctly, but only for 3-5 seconds? I have no other actors, rules or timers running!

Anyone else ever have this issue? Am I missing something in order for this toggle to work?

Thanks in advance.

Comments

  • BBEnkBBEnk Member Posts: 1,764

    I downloaded and tested your and it does what you said stops working after a few touches but when I made my own version it worked perfect, weird.

  • rcheethamrcheetham UKMember Posts: 14

    Just figured it out, human error! I forgot I turned gravity on and forgot to change the button to not be movable, therefore the button was slowly falling off the screen!

    I'm a fool, apologies to @BBE and those who looked into this at all!

  • BBEnkBBEnk Member Posts: 1,764

    Yes I just seen that when I change color,lol.

Sign In or Register to comment.