Object in collision with itself

i have several duplicates of the same object on the screen at the same time and i want to check the collision between them. by simply doing:

“for each Object X”

  • Object X is in collision with Object X > “this happends”

this doesn’t work at all. i’ve tried the point inside object too but it doesn’t work either. how to check for collisions with several of the same objects?

I could not find any way to collision check between same object
BUUUT for whatever reason distance between two objects work for same objects

This is something against which I have been banging my head countless times : In GDevelop you can’t separate objects of the same type into 2 different pools (or said differently : Object X can’t interract with Object X).

But, there is a trick !
At the start of the scene, for each Object X, you create another object (you might call it "Collided’), which has the same hitbox as Object X. You stick it with Object X with the sticked behavior (so each Collider follows his Object X) , and you link them together.

Now, you can check “Object X is in collision with Collider” , and each collision you filter out the Object X and Collider which are linked together.

It is a bit of work… But that’s (almost) exactly what I have done in this project : JupiterDive | Play on gd.games

Can I ask what you’re making? What do the objects represent? There might be a different way to achieve it.