Better to use collision or overlap?

0 favourites
  • 3 posts
  • Is there much difference between the collision and overlap conditions? Just wondering in case 1 of them is more efficient or something. Is the collision trigger checked every tick? Whereas with an overlap condition, I have more control as I can use it as a 3rd condition or a subevent, so the overlap is only checked when I need it to be. But if collision is a very efficient/simple/non-intensive condition then it doesn't matter which one I use?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The main difference are that collision is a trigger and overlap isn't.

    Thus collision is an instant condition, it's true the first tick where the object start overlapping, and then false.

    But! It's a trigger. So it's not exactly the same as doing

    Object: is overlapping
    System: trigger once

    The main difference as far as I know is that triggers aren't checked in the main event loop order. But (not sure) checked before even running the entire game loop, for better speed.

    So you have to be aware that orders between triggered and non trigger events might not be respected. (but order inside a triggered block or between triggers of the same nature are respected)

  • Actually, in the SDK, 'On collision' is a "fake trigger", meaning it's treated in the editor like a trigger but coded like an ordinary condition!

    'On collision' is therefore treated almost exactly like:

    + Is overlapping

    + Trigger once

    'Is overlapping' actually does looping over the affected instances which is not usually noticable, but that behavior should be removed from a future build anyway since it is inconvenient in some situations.

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