Unity 2d enemies overlapping


#1

Hello guys, I implemented astar pathfinding using the free version for my game, but I had to remove rigidbody from my enemy character because then it would be very buggy and barelly work.
My question is can I somehow make rigidbody and a* work together? Or how can i solve enemies overlapping without it?


#2

Hi

For overlapping enemies I would recommend using local avoidance (see https://arongranberg.com/astar/docs/local-avoidance.php) instead of rigidbodies. Rigidbodies can work well for a small number of agents, but usually they get clumped together. Local avoidance is pro only however.

Rigidbodies work together with the included movement scripts, but it’s only intended for interacting with other obstacles, not other agents.


#3

Hello, sorry for the late reply, but is there any other way to change without going pro since its my simple project in university. Or at least is there a solution to fix that overlapped enemies shares damage?