How do I enable/disable objects (Map)

Get help using Construct 2

Post » Mon Jul 17, 2017 7:38 pm

I created a world map that takes up half of the screen.
I'm racking my brain trying to enable and disable on object touch.
I'm not sure how to switch between two variables on the same button.
So, say I touch the main player character, on touching the character I want it to enable and disable the map.
I use to know functions and variables a bit better but its been a while and now I'm just getting frustrated.
Also not sure how to disable things if invisible.
B
6
S
1
Posts: 29
Reputation: 408

Post » Tue Jul 18, 2017 8:11 am

Use a variable as a condition.
On player touched, var = 0, > open map, set var=1
On player touched, var =1 > close map, set var = 0

You might need to put a small wait in though as due to C2's top down structure, it'll set the variable true for both events reading down.

You're right that simply setting the object invisible will not disable it. For a button you'll need to set it disabled. For a sprite you can disable it's collision.
B
46
S
16
G
78
Posts: 2,168
Reputation: 46,353

Post » Tue Jul 18, 2017 9:19 am

@justintime0185

Maybe something like this?

https://www.dropbox.com/s/7t729f0530th2jj/Switch.capx?dl=0
B
39
S
22
G
77
Posts: 285
Reputation: 42,686


Return to How do I....?

Who is online

Users browsing this forum: PROxMTswatTR and 17 guests