Enemy Collision Problem

You have to set the enemy on a path. It doesn’t just happen automatically. You need to tell the pathfinding object where it has to go to.

So instead of moving the enemy skeleton to the wizard player using force, you use the pathfinding action move to :

And are you sure you want to invert the distance condition? It’ll only move skeleton enemies that are over 200 pixels away.

1 Like

The problem with this is that the enemy will target the player all the time, not just when they’re more than 200 pixels away.

1 Like

Yes, but this is just a demo of fixing the enemy collision problem, not making the enemy and setting everything.

1 Like

I added that condition because I want the enemy to attack. (shoots bones) It’s another topic but it’s working fine.

If I use Group instead of just that type of enemy, would it work?
Edit: Because my game have a lot of different types of enemy so I need all types of enemies to not collide with each other.

I don’t know about that. Try experementing with it.

1 Like

So long as they all have the pathfinding behavior, a group will work just fine.

1 Like

So I’ve tried all your suggestions and it kinda works but the condition pick the nearest enemy within the player is kinda bad for the enemies looks like this when played.
image
I know that this condition is the main reason why this is possible. For it stops the nearest enemy so that others can move to separate them to each other but the problem is that when the nearest enemy stops, others will go above it and it kinda looks ugly because their z-orders are different some goes above and some goes beneath.
I expected it more like this:
image
Where they didn’t stack at all (depends on the hitbox the enemy have) like in physics games where the blocks never pass through each other but always finds a way to move in a certain position.

I will think about it, about how to do that and if I got the solution to your problem, I will share it with you here.

1 Like

Thank you so much! I’m sorry that this problem takes too long to solve. I really appreciate y’all for helping me with this!:heart:

Edit: Hoping to solve this soon!:heart:

1 Like

Don’t worry everyone wants this solution for their games HAHA

i tried setting the object as impassable but that disables movement perhaps we just need it not to and using costs don’t really work

seems the longer i try search the forum for a solution the more post of people who have encountered the same problem with no good solutions, now i know why gdevelop games are like 90% platformers with linear ai’s

this post might give you some ideas

im going to go look if some extensions may help or maybe some genius will make one :DDD

1 Like

nice graphics anyway. I think you can’t rely on a single behavior, but you have to write your mixed routines of various gifts that GDEVELOP gave us.

2 Likes

You are right @ErmesBertone

2 Likes