1 Button doing 2 things!

0 favourites
  • 3 posts
From the Asset Store
J-BoB Game Button Sound Pack comes with 300 high-quality sound effects
  • Greetings there! I have been searching for this for a while and been trying aswell, but can't get it to work tbh.

    I want 1 button to do several things depending on what.

    For example C opens inventory (like in wow) - but if its already opened it should be closed. - Here is the problem because on 'pressing C' it doesn't let me add an 'else' right after! Why? :/

    Some help please - and thanks for your time and this awesome community!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is a job for sub-events! Create your key press condition

    On C Pressed.       Now right-click on it and add a sub event (I think S is the shortcut). Now add your other conditions

    -------Box.Whatever = "closed" | open the box, set box.whatever to "open"

    -------Else | close the box, set box.whatever to "closed"

    The indentations help your know you're in a sub event. Basically, when you press C, it then triggers evaluating the other conditions. How you were trying before wouldn't work because the "else" of on C pressed is infinite. Sub events fix this by letting you run multiple layers/tiers of conditions off of one action.

    I hope that solves it for you!

  • Oh wow dude! It surely worked fine! Thanks alot for your epic and sexy answer ;D - cant believe this community is.. almost perfect! Makes me sad in a way to see such helping people - well ofc sad due to happiness indeed ;D thanks yet again!

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