[SOLVED]Is there a way to detect when two objects are continuously colliding with each other?

0 favourites
  • 7 posts
From the Asset Store
This is a Dungeon Master tool & the 1st of 12 Combat Engines from the Building Combat Engines for Browser Games workshop
  • The collision can only detect the one that it hits.They use physics behaviors and cannot overlap

  • Use the condition called "Is overlapping at offset".

  • Use the condition called "Is overlapping at offset".

    My two objects are circles. If I use "Is overlapping at offset", the offset point XY can only detect one point. Is there a convenient formula? What I am using now is to compare the two values ​​​​distance (friendly circle.X, friendly circle.Y, enemy circle.X, enemy circle.Y) < (friendly circle.Width / 2) + (enemy circle.Width / 2).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > Use the condition called "Is overlapping at offset".

    My two objects are circles. If I use "Is overlapping at offset", the offset point XY can only detect one point. Is there a convenient formula? What I am using now is to compare the two values ​​​​distance (friendly circle.X, friendly circle.Y, enemy circle.X, enemy circle.Y) < (friendly circle.Width / 2) + (enemy circle.Width / 2).

    If you don't need to check at offsets then you should always use the normal condition:

    "Is overlapping another object"

    You will probably want to adjust swell the collision points of the circle if you need it to be 100% accurate instead of a Square box.

    If you need to check the offsets, the manual can help you in how it works:

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/common-features/common-conditions#internalH1Link10:~:text=Is%20overlapping%20at%20offset

  • > > Use the condition called "Is overlapping at offset".

    >

    > My two objects are circles. If I use "Is overlapping at offset", the offset point XY can only detect one point. Is there a convenient formula? What I am using now is to compare the two values ​​​​distance (friendly circle.X, friendly circle.Y, enemy circle.X, enemy circle.Y) < (friendly circle.Width / 2) + (enemy circle.Width / 2).

    If you don't need to check at offsets then you should always use the normal condition:

    "Is overlapping another object"

    You will probably want to adjust swell the collision points of the circle if you need it to be 100% accurate instead of a Square box.

    If you need to check the offsets, the manual can help you in how it works:

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/common-features/common-conditions#internalH1Link10:~:text=Is%20overlapping%20at%20offset

    "Is overlapping another object" is useless. These two objects use the "Physics" behavior. The "Physics" behavior can set the collision boundary to a circle. They cannot overlap and can only push each other. The manual shows that offset cannot solve this problem. there is no better way than to detect the distance between the two.

  • > > > Use the condition called "Is overlapping at offset".

    > >

    > > My two objects are circles. If I use "Is overlapping at offset", the offset point XY can only detect one point. Is there a convenient formula? What I am using now is to compare the two values ​​​​distance (friendly circle.X, friendly circle.Y, enemy circle.X, enemy circle.Y) < (friendly circle.Width / 2) + (enemy circle.Width / 2).

    >

    >

    > If you don't need to check at offsets then you should always use the normal condition:

    >

    > "Is overlapping another object"

    >

    > You will probably want to adjust swell the collision points of the circle if you need it to be 100% accurate instead of a Square box.

    >

    >

    > If you need to check the offsets, the manual can help you in how it works:

    > https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/common-features/common-conditions#internalH1Link10:~:text=Is%20overlapping%20at%20offset

    "Is overlapping another object" is useless. These two objects use the "Physics" behavior. The "Physics" behavior can set the collision boundary to a circle. They cannot overlap and can only push each other. The manual shows that offset cannot solve this problem. there is no better way than to detect the distance between the two.

    I missed your second post where you mention the Physics, I apologise:

    My answer was for non-physical objects.

    If both objects have the physics behaviour then indeed the overlaps check will not work, as it will resolve the physics collisions first and push them apart, and by the time it checks for overlaps, it is too late.

    1-Distance check is a great alternative.

    2-You can also use invisible colliders as an alternative:

    Here is one example:

    https://www.dropbox.com/scl/fi/pq3f2ne6q2sjngo020bxp/1-Physics-Overlaps.c3p?rlkey=0pues73jekqf4fzyzdttl3q3w&dl=0

  • > > > > Use the condition called "Is overlapping at offset".

    > > >

    > > > My two objects are circles. If I use "Is overlapping at offset", the offset point XY can only detect one point. Is there a convenient formula? What I am using now is to compare the two values ​​​​distance (friendly circle.X, friendly circle.Y, enemy circle.X, enemy circle.Y) < (friendly circle.Width / 2) + (enemy circle.Width / 2).

    > >

    > >

    > > If you don't need to check at offsets then you should always use the normal condition:

    > >

    > > "Is overlapping another object"

    > >

    > > You will probably want to adjust swell the collision points of the circle if you need it to be 100% accurate instead of a Square box.

    > >

    > >

    > > If you need to check the offsets, the manual can help you in how it works:

    > > https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/common-features/common-conditions#internalH1Link10:~:text=Is%20overlapping%20at%20offset

    > "Is overlapping another object" is useless. These two objects use the "Physics" behavior. The "Physics" behavior can set the collision boundary to a circle. They cannot overlap and can only push each other. The manual shows that offset cannot solve this problem. there is no better way than to detect the distance between the two.

    I missed your second post where you mention the Physics, I apologise:

    My answer was for non-physical objects.

    If both objects have the physics behaviour then indeed the overlaps check will not work, as it will resolve the physics collisions first and push them apart, and by the time it checks for overlaps, it is too late.

    1-Distance check is a great alternative.

    2-You can also use invisible colliders as an alternative:

    Here is one example:

    https://www.dropbox.com/scl/fi/pq3f2ne6q2sjngo020bxp/1-Physics-Overlaps.c3p?rlkey=0pues73jekqf4fzyzdttl3q3w&dl=0

    Invisible colliders are really useful and are great for irregular shapes. Thanks for your reply

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