I have a group of several monsters (called “monsters”). In my game, the game continuously spawns monsters which move towards the player via instant forces (top down). I have an event which says if “monsters” is colliding with “monsters”, seperate them. The goal here is so that none of the monsters in the group will overlap with each other. This currently only works between monster instances of the same object, but i want it to work for everything in that group.
Can you post a screenshot of your events? Instances can be difficult to impossible to easily manipulate. It’s one of my biggest annoyances. Sometimes, the fix is to use a seperate hitbox object.
I had the same issue and I saw many people have it too. I didn’t find any other way with dealing with this, other than having a separate event that distinctively says: monster1 separate from monster2, monster3, monster4…However, keep an eye on the performance when doing it.
Hopefully someone has a better way of solving this.
Btw, you don’t need a condition to check when instances collide to separate them. Separation action takes care of that on its own.
I second that dealing with instances is one of the worst things to deal with, especially when coupled with for each .
IDK if you saw this tutorial or if you’re already changing the z-order. It’s part of a series and might help. It sounds similar to yours. Instead of separating objects, it just sets the z-order to the Y() value. There’s an extension but it’s just as easy to do it yourself.
Edit: I’m watching the video and it does address collisions but it still looks better if they’re allowed to overlap a little using a slightly smaller hitbox and z-order.
The video I believe only has 1 object type. I’d have to test it myself to understand the issue. It’s a common problem and IDK if there’s a real fix or just workarounds. It’s a tough situation. Sometimes the solution works but not efficiently.
i tried removing the condition, but that didnt work. what i will probably end up doing is just have a different collision event for each monster, and check if the object is colliding with a member of the group. tedious but its what im gonna need to do.
Yeah that’s exactly how I deal with that problem. The only other thing I could think of is checking if monsters are colliding with each other, and if they are, pick the monster that is furthest away from the player with *inverted* pick nearest object condition and use stop object action. This only works if monsters are moving towards the player though.
I don’t fully understand. Do monster 1s all stay away from other monster 1s? If so, make them all the same object and when spawned assign them a random animation. Or am I misunderstanding the problem?