Position multiple objects until no collision

Ok, @Stefan and @mikhailo, here’s another tricky challenge: I want to create a lot of randomly-place and randomly-sized objects in a space, without them touching each other.

I’m attempting this with CoBlocks first, by looping through, creating one Item at a time, adding an advanced collision event, then trying to remove the event once the Item is no longer touching anything else. It’s removing the event which is the issue. Here’s my attempt:

I’ve tried multiple ways, including doing the collision check + repositioning in a separate forever loop and using the event for setting a IsTouching boolean variable, but either way, I can’t find a way to detect that the Item is no longer collided (so I can remove the event).

Any ideas?

Geoff @ TechLeap

1 Like