How do I switch steps properly

  • Hello, I have big problem with simple issue.

    I want to switch variables by clicking on sprite but it doesn't work properly. I'm using logic shown below:

    On Sprite1 clicked and variable A = 1 THEN set variable A to 2
    On Sprite1 clicked and variable A = 2 THEN set variable A to 3[/code:1bma39au]
    It's changing variable A from 1 to 3 instantly.
    
    I noticed that when I'm destroying sprite after click it's working:
    [code:1bma39au]On Sprite1 clicked and variable A = 1 THEN set variable A to 2 and destroy Sprite1
    On Sprite1 clicked and variable A = 2 THEN set variable A to 3[/code:1bma39au]
    
    Think I just need to make Sprite1 inactive for a 0.1s before next click.
    Or there is any proper way to make a sprite button?
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Make a subevent after the 'on click'-event, with an else branch.

    Mouse| On Left button clicked on Sprite ->

    ........System| A=1 -> System| Set A to 2

    ........Else

    ........System| A=2 -> System| Set A to 3

  • Thanks for reply.

    Tried this but its working the same way: after click changes instantly from 1 to 3.

  • Works for me. Do you have the else and the compare condition in one event?

  • It's working now. Thank you.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)