0 Favourites

Better to use collision or overlap?

  • 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?

  • 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)

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • 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)
Similar Topics Posts Views Last Post
Unread hot topic
76 9,271
Pandadoor's avatar
Pandadoor
Unread hot topic
57 53,160
weilies's avatar
weilies
Unread hot topic
0 Favourites
[plugin] 3D using Copperlicht
72 25,981
Reken's avatar
Reken