[Solved] Collision and Spawning with Object Instances Of The Same Type

Hi, this is my first post on this forum.
I’m trying to make an evolution/natural selection simulator in GDevelop.

Currently, I’m having issues with object instances.
I wanted organisms to reproduce with another organism after fully fed, so I came up with this:

However, it only checks if one of the organisms wants to reproduce, but I want both objects to meet that condition for it to activate.
How can I differentiate between the object instances to check such a thing?

Why don’t you try to identify the organism by gender with a variable
like gender=Male gender=Female

So it would be easy for you to iterate in a repeat organism then check if a pair is male/Female then reproduce else not reproduce

In that case, I would need to assign each object instance a variable when born, which again means I would need to specify the newborn organism on the condition.

you can always treat all the objects as an organism even if they are alive or dead think as family

Organism->Father → name “Eric” → is male and has power of 10
Organism->Mother → name “Magda” → is female and has power of 20
Organism->Child → Maximo → is male and has power of 5
Organism->Child ->Wanda → is female and has power of 3

All are organism but they can be male or female and have diffent powers or abilities.

So two objects collide, and you want to be able to refer to both of them individually…

One option might be to (in a sub-event of the collision) pick the object closest to point 0,0 (then check its reproduction variable, etc.). Then in another sub-event pick the object furthest from 0,0 (i.e. the other organism out of the two) and check its variable. That’ll hopefully be one way to differentiate them.

Look I made some example I don’t know if this is what are you looking
https://drive.google.com/file/d/1uH2fH10riNI-RbGd89Y6h9XGYJRLooLb/view?usp=sharing

That only works when I have two objects. If I have more, it might check an object which wasn’t in a collision in the first place.

I think that will work, thanks!
Though I’ll still need to differentiate the organisms after mutation (giving a random variable number to an organism when they’re born, like genes), and at some point, I will need a solution to that problem.