How do I fix this issue?

Get help using Construct 2

Post » Mon Aug 21, 2017 5:48 am

Message: Cha0tiXGamer can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
So I've had construct 2 for a while but I was never committed to making a game for over a couple of days. But recently I've started to work on a project and I ran into an issue. I was trying to make a menu pop-up when you hit a specific sprite but for some reason it won't work and I don't know why... heres an image.

http://imgur.com/a/2QYQE

If I delete Sprite>Menu Button 0/1 it will work, but it won't work with the condition.

I'm stumped on this so I hope someone knows what I'm doing wrong :D.
B
2
Posts: 2
Reputation: 154

Post » Mon Aug 21, 2017 7:24 am

Hi @Cha0tiXGamer !

In fact, this is what happens when you click on your sprite :
-> All the triggers "On Sprite Clicked" fire from up to down.
-> So first, the one with MenuButton = 0. It makes everything nice and visible, and set MenuButton to 1.
-> And then, the one with MenuButton = 1 WHICH IS ALSO ACTIVATED because MenuButton is now to 1.

It lacks an "Else" condition, basically. Try something like this. ;)

Code: Select all
On left Button Clicked on Sprite >
                         -> MenuButton = 0 : Do all your actions
                         -> Else AND MenuButton = 1 : Do all your actions
Image
B
10
S
3
G
2
Posts: 78
Reputation: 1,729

Post » Mon Aug 21, 2017 4:18 pm

Bro7hers wrote:Hi @Cha0tiXGamer !

In fact, this is what happens when you click on your sprite :
-> All the triggers "On Sprite Clicked" fire from up to down.
-> So first, the one with MenuButton = 0. It makes everything nice and visible, and set MenuButton to 1.
-> And then, the one with MenuButton = 1 WHICH IS ALSO ACTIVATED because MenuButton is now to 1.

It lacks an "Else" condition, basically. Try something like this. ;)

Code: Select all
On left Button Clicked on Sprite >
                         -> MenuButton = 0 : Do all your actions
                         -> Else AND MenuButton = 1 : Do all your actions


Thank you so much! Took me a while to realize that I needed to use a sub-event.
B
2
Posts: 2
Reputation: 154


Return to How do I....?

Who is online

Users browsing this forum: darkrealos, dop2000, Rhindon and 20 guests