Is there a project sample for Enemy AI that follows player without clamping together?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By KramchayDig

It would be great if there is someone who have a project sample (2D or 3D) of a pathfinding AI that doesn’t clamp together when it gets near to the target.

what do you mean by clamping?

Xian | 2019-11-05 16:00

:bust_in_silhouette: Reply From: kidscancode

What you want falls under the category of “steering behaviors”, a general term for coding realistic behavior on autonomous agents.

There’s a really good overview of various applications here:

The examples aren’t for Godot, but they are well-explained and should be relatively easy to implement in GDScript.

It would be nice to have a tutorial on that, as it is really useful. My way of coupling with that was using area2D, and whenever another object crosses it, it will push both objects in opposite ways.

The_Black_Chess_King | 2019-11-06 02:10

:bust_in_silhouette: Reply From: Asheraryam

There is PR in progress that adds collision avoidance, once it is merged there will be official support for this behaviour.