How do I switch steps properly

Get help using Construct 2

Post » Tue Jun 28, 2016 6:33 am

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:
Code: Select all
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

It's changing variable A from 1 to 3 instantly.

I noticed that when I'm destroying sprite after click it's working:
Code: Select all
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


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?
B
9
S
3
G
1
Posts: 21
Reputation: 1,142

Post » Tue Jun 28, 2016 6:44 am

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
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Tue Jun 28, 2016 6:53 am

Thanks for reply.
Tried this but its working the same way: after click changes instantly from 1 to 3.
B
9
S
3
G
1
Posts: 21
Reputation: 1,142

Post » Tue Jun 28, 2016 6:59 am

Works for me. Do you have the else and the compare condition in one event?
Image
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Tue Jun 28, 2016 7:24 am

It's working now. Thank you. :)
B
9
S
3
G
1
Posts: 21
Reputation: 1,142


Return to How do I....?

Who is online

Users browsing this forum: oosyrag and 31 guests