How to make a button with boolean

Hey I'm trying to create a button that can be pressed and it does something and then I press it again it will go back to the original, so how can I make a Boolean go from true to false and back to true?

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Use an integer instead.

    When pressed change X to 1-X

  • Phoenix256Phoenix256 Member Posts: 42

    sorry I don't think I understand what your trying to say

  • ArmellineArmelline Member, PRO Posts: 5,354

    This question was answered numerous times in numerous ways with screen shots and demos in your other thread.

  • Phoenix256Phoenix256 Member Posts: 42

    but it never works all it does is changes but when I press it again it does nothing every way I try.

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2015

    "how can I make a Boolean go from true to false and back to true?"

    Use an Integer attribute instead of using a Boolean attribute.

    Let's call this integer attribute 'X'.

    Then use the following rule:

    When touch is pressed: Change attribute X to 1-X

    This will change X between 0 and 1.

  • ArmellineArmelline Member, PRO Posts: 5,354

    @Phoenix256 said:
    but it never works all it does is changes but when I press it again it does nothing every way I try.

    Until we see the logic you're using, we can't help much. We've told you at least 3 different ways to do it that do work. If it isn't working for you, you've done something wrong. So you either need to keep trying to replicate the suggestions you've been given or give us more information about what you're actually doing, so we can try to tell you what it is you're doing wrong.

  • Phoenix256Phoenix256 Member Posts: 42



    Finally I found an unblocked site, here are pictures of the way I have it set up, there are two because it wouldn't fit.

Sign In or Register to comment.