Some conditions can't be used in one event?

0 favourites
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • I am making a dog simulation game. I had a lot of info about the problem written, but my computer turned off and all I wrote wasn't saved. So shortly:Why can't I use the "on collision with another object" and the "Keyboard: On Z pressed" conditions on the same event?

  • Of course you can do that, what was the problem ?

  • Hard too descripe for me cause I?m no native english speaker. So I just tell you how to fix it:

    + Keyboard: On Z Pressed

    ++ subevent Sprite is overlapping Sprite

    --> Do something

    It is cause this are 2 "On" Events.

  • Why can't two "On" conditions be in one event?

    A sub-event? Where will all the actions be?

  • So shortly:Why can't I use the "on collision with another object" and the "Keyboard: On Z pressed" conditions on the same event?

    You can't do that , because they are both triggers. Check this manual entry for more indepth explanation.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I beg to differ, you can have two triggers in the same event block.

    Right click the main event block and make it an 'OR' block. I just tested it and it lets me do it in the editor.

  • I beg to differ, you can have two triggers in the same event block.

    Right click the main event block and make it an 'OR' block. I just tested it and it lets me do it in the editor.

    Absolutely, but functionality would not be what I'd imagine he is aiming for :)

  • Rrr please don?t laugh about my try to explain it you :D I?m really no native speaker.

    If you make something like:

    On collide

    -AND-

    On key press

    They cant exactly trigger at the same time, this is the problem.

    "On" are "real" Events, they really trigger only once as soon as you tell it them.

    "None Real" Events are something like:

    ->System compare 1 = 1

    This get handled like: Every Tick "if value 1 = 1". in c2 it was just made easier.

    Every tick is also a "real" Event the only difference between "on" is that this event get called every Tick not at the moment you tell it him.

    If you know how Javascript(This is the language on that C2 is based) works it would be easy to explain it to you.

    You only really need to know that On is a call and not a condition.

    Hope it helps you a bit, if not just wait till any native speaker got time to explain it to you :D

  • Pretty clear explanation

    I thought it was possible to do this in the same event like

    if (collide AND ZPressed){

    Do Action

    }

    But as soon as they are "real" events, yes i understand why it would'nt work

  • An event with two triggers in it is a bit like an event saying "On the exact moment lightning strikes, AND the exact moment the clock reaches midnight". They will effectively never happen at the same time. It's not a perfect analogy though - in Construct 2 triggers always fire one at a time, so rather than being highly unlikely, it's actually impossible that any such event could ever run.

    You most likely just want to have this instead:

    + On collision

    + Z key is down (not 'on pressed', the 'is key down')

    or this:

    + On Z key pressed

    + Sprite is overlapping (not 'on collision', the 'is overlapping')

  • Thank you, everybody!

    One last question: What's the difference between is overlapping and on collision? If you don't have anything else to do, huh.

  • On Collide is an "Event" means as soon as this happens do it once.

    Is Overlaping is just a if(question) means Every tick if "is overlapping" do it.

    The difference is just the first one is a Call and the other one is just a Question :D

    In your situation:

    ->On key Press Z

    ->Is overlapping

    means:

    On key Press Z and if Sprite is overlaping trigger the event

  • Just to add on to what Darklinki said. Think of the "on collision" as the very first tick that the two sprites are overlapping.

  • Oh, that's it? Nice.

    What's your native language?

  • German :D

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